+1 vote

I'm not sure if this is a bug, but I'll ask for a solution here.
I have a slime scene that attacks the player. It uses an AnimationPlayer node which contains the attack animations. The animations have tracks for AnimatedSprite:animation, AnimatedSprite:frames, and a track for disabling and enabling an Area2D's collision shapes, which are its attack areas.

The only problem comes when instancing multiple of them. When I instance multiple slimes, I get an error where the track couldn't resolve, and the AnimatedSprite and Area2D nodes weren't found.

Then they won't do their attack animation, or their animations glitch weirdly.
When I tried to restart the editor, the AnimationPlayer's animations were cleared of their tracks. I've had this problem for a while now, and I've tried saving the animations, deleting the slime instances, but the bug always happens no matter what. I want to know how to fix it.

in Engine by (38 points)

2 Answers

0 votes

Hi, just need to get the correct path, just just get_node() instead of $ and insert the correct path , you could drag it form the editor.
good luck

by (197 points)
+1 vote

Luckily, I've found the solution to this problem!
Turns out I had to put each of them under their own respective node. That way, their animations can work more efficiently.
I realized that each node must control their own things, and that was the reason why their animations were glitching.

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