The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+2 votes

So in my platformer game I've got those typical crusher thingies that move up and down and deal damage if they squash the player. I used AnimationPlayer to create the animations for moving up and down. I'm using property track and changing the position of the parent node.
My main goal here was to create external variables in the script so that I can have some of them raise higher and some lower (as shown in the picture - I'd like the left one to go up 32 pixels, and the right one only 16). To do that, I used tracksetkey_value to change the top position in the animation. However, it appears that animations, even if not saved, are a global resource and changing the key in one instance affects both, most likely taking the value of the one that loaded later.

Is there any workaround for such a thing?
If there's nothing I can do, I could just create separate 32px and 16px animations, though being able to set it to any value I want would certainly give me more flexibility.

picture

in Engine by (39 points)

Please log in or register to answer this question.

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.