0 votes

(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.

Godot version 3.5
in Engine by (32 points)

1 Answer

+2 votes

This is just how shaders and materials work. They are resource data type, so they are shared by all instances by default. To undo this, You need to get to material properties in editor, find resource tab, and tag local_to_the_scene

by (7,925 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.