Pause animations in Unity

Daniel Kirwan
2 min readJul 8, 2021

Objective: Pause the camera animation when the player is detected

The next thing for me to do with my security cameras is to stop the animation from playing once the player has been detected, the colour of the cameras will also need to change to show the detection.

To change the colour of the mesh renderer I need to get a reference to it, I then set up a colour for the camera. The next step is to change the colour of the material, and in this case the tintColour of the material. The property that you may have to change could be different, here is where I found mine.

Click on the material that you’re using, then on the shader options click edit.

Different materials and shaders will have different properties that can be changed. For me, it is the _TintColor property.

Once the colour has been changed I then set the animated to false, which will turn off the component and it will stop the animation from playing.

And that is it for this article. If you want an easy way to stop and animation, just set the component to false.

--

--