Hello i’m using the animator component but when I disable it and re enable while the animation is playing the object stays where it was first disabled and doesn’t go back I did a little bit of research and people say this is a bug So? is there anywhere around this then?!?
I would send a image of what it looks like but Unity’s website glitching out rn ill post asap if needed.
You need to make sure you added keyframes for all of your animated properties in each animation clip, otherwise, this is a tricky solution:
Create an empty state in your animator controller, its name by default is “New State”.
Make sure the “Write Defaults” is on for that clip.
Do this whenever you want to disable your GO:
anim.CrossFade(“New State”, 0f);
While “anim” is your Animator.
It works on Unity 5.x
if you still have problems, try called anim.Update(0) 3 times or more.
This may be a bug. But you might be able to avoid it by instead of disabling and enabling the component, stopping and starting the animation in the component.
I have the same bug, unfortunately. Although, it has some randomness because I wasn’t able to reproduce it in a smaller test scene with two cubes.
Generally, more complex stuff doesn’t like being activated or deactivated in Unity. This is just another bug in the long list.