0 votes

I have an instanced node that's used by multiple creatures. One of them does not have the same child nodes that are being commanded by the animator so it deletes those animation tracks in order to not receive a bunch of errors. However in doing so, it deletes the animations for all creatures using that instance!

It would seem the animation tracks are not properly instantiated and are instead shared between everything that instantiates the animation player. That may be a bug on it's own, but for now I'd like to work around it. The easy way to do so would be to discard the instance of the animation player from the one node that differs.

How would I be able to discard the instance from code so the different creature can merely have a copy of the instance to modify for itself?

in Engine by (66 points)

Is this the same issue? https://godotengine.org/qa/13573/running-multiple-animation-player-nodes

Possibly this if you need to do it from code https://godotengine.org/qa/9190/make-a-resource-unique

Grasping a little bit here - but maybe some pointers

No longer a problem, but certainly confusing that animations are considered resources. Because of that they can't so easily be modified without shared instances being affected. For the record I did not solve this problem. I made two separate nodes to instantiate for the different creatures involved. I then modified the animation tracks from there.

Scene inheretence might've saved me the trouble, but sadly there is not much of any documentation on how to implement this. I decided to go the safe & easy route for now.
Thanks to Karoffel & dj_pale for their solutions & help.

You can save animations as resource files then load them on empty AnimationPlayers, resources are easy to edit with a text editor too if you have many similar animations.

I tried that and it would still modify tracks over the same file. If I use separate animations then they aren't shared. I decided to separate them completely with different copies of the animations & animation players.

1 Answer

0 votes
Best answer

Animations are treated as resources, that is the source of the problem. If one deletes tracks from an animation from an instanced animation player that is instantiated to multiple objects, then that track modification will affect all other instances. Therefore I will have to design my characters in a way to where they use separate animations in the case of there being missing nodes without modifying the tracks directly.

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