(Using MouseEntered()
and MouseExited()
) When hovering the mouse over a card, it plays an animation that moves it upper a bit and change the alpha
value towards 0 or 1, depending whether I need it shown or not.
The hovered one behaves at it should be, the problem comes when every single card plays the shader animation only. So I must assume that the problem is how I'm changing shaders properties. I'm changing it using the AnimationPlayer
node, and changing the alpha value from the colour pick within the shader properties.
Just for clarification, because maybe this might be the cause of the problem as I read about "singletons" and sounded like so. The way I handle different types of cards consists in an only card template, that holds the AnimationPlayer
node and the behavior script all sorts of cards must run. For every different type of card, I create a new scene, add a new instance to the template card, and a config node that runs when the button is pressed. I autoloaded a scene that has a export (Array, PackedScene) var upgrades
variable witch loads every card randomly from this array.