Stop animation on canvas.

Hi guys I have a problem that I can’t solve: I have an animation on Animator that starts when I press the mouse button. That animation, I want it not to be performed when I make a canvas appear. How can I do it? Thanks to all.

Before you start the animation on mouse down, check if the canvas is present. If so, don’t start the animation.

That’s the best I can do without seeing any code.

There’s no default appear/disapper events or mechanics in unity. If you make your canvas appear using SetActive(true) then you may either stop animation whereever youre activating that canvas or add custom script on that canvas with unityevent public event and fire that event from OnEnable so you may subscribe to this event and make the animation stop by setting some trigger or diabling animator or other way.

1 Like

Grazie Palex