I am actually working on a simple project and I want some cube to disappear slowly when the arrived in a CollisionShape. So I decided to use a Tween to interpolate the alpha property of the albedo of the material of the meshInstance. But this change work for every cube of the world and I don't understand why. Here is my code :
var mat = $MeshInstance.get_mesh().get_material().duplicate()
var tween = Tween.new()
tween.interpolate_property(mat, "albedo_color:a", 1, 0, 1,
The function disappear() is call when the object collide with the collisionShape.
My cube object is very simple. This is a StaticBody composed of a MeshInstance and a CollisionShape
Thanks for any help !