Godot Version
4.4
Question
I’m trying to have the bullets (green and purple things shooting from the boxes) fade from their opaque color (col1/ability.color) to a transparent color (col2/ability.colorfade) after a second or so. So as to not have to create several animations for essentially the same base function, I tried to alter the keys in the animation track programmatically. However, the purple bullet, once its fade animation is triggered, is taking the colors from the green one’s animations. They should be entirely separate instances. When I’ve printed col1 and col2 to the output window alongside some info to help discern which type of bullet they belong to, the colors return correctly. I assume it must be something to do with the Animation player, though I should clarify I am grabbing the Animation Player with a get_child() function. So… it shouldn’t be tied to the exact same node.
I’m not sure if there is simply a setting I’m missing to make them unique. The colors are derived from a custom resource in which they are defined. The code below shows how the bullets are instanced; the purple ones are spawned in the timer 1 timeout func and the green ones are spawned in the timer 2 timeout func.
I’ve tried looking into deleting the animation entirely and then loading it in by having it saved as a resource, but there seems to be no way to entirely delete an animation from a player through code? At least not that I could find. I would rather not have to create animations entirely through code at runtime if I can avoid it. Any help is greatly appreciated. Thank you in advance!