Disable animation

Hi guys I would ask you one thing: I would disable an animation when a Gameobject is deactivate and when it is activate (gameobject), the animation can play (animation trigger is in an animator of the player). Can I do it? thank a lot.

And what if you make an animation.Play(); in the same function when you activate the object?

You can do it. I believe in you. :slight_smile:

No red_carrot is contrary…when the Gameobject is deactivate, the animation in the animator must be deactivate but when the same object is active, the animation can play on trigger!

Hmmm… and if you make a bool to set both states?

Something like

Animator anim;
GameObject thisGo;
bool state;

void Update()
{
thisGo.SetActive(state);
anim.SetBool("trigger", state);
}