I have two duplicate objects in my scene which have the same sprite animation, but I am unable to play both animations independently. If there is only one object, the animation plays fine, but as soon as there are two or more objects, only one of the objects will play its animation. Is there a good way to have the duplicate objects play the same sprite animation (in different locations) without having to make a new animation each time?
In case it is important, the animation is triggered by an OnTriggerEnter2D event. I believe I have all the colliders/rigidbodies set up correctly.
Hi @MehruneD , sharing same animation is good practice if you have same kind of animation playing between your game objects.
Playing one animation on any gameobject that doesn’t means that every gameobject which have animaton attached will be played.
You have to control every animation individually (via AnimationController). I think you got the clear idea.
So it turns out that setting the “animator” and “spriteRenderer” in start/awake was the problem. To solve the problem, I removed those lines of code, made the original variables “serializefield,” and defined them in the inspector.