Freeze Camera when Player is found

Security Camera part 2

Watch the Camera cone that finds the player stops moving

In this article we will stop the camera from moving when the player is found from code.

To achieve this effect we will simply disable the animator when the player is found.

Stop Camera movement on Player Detection Code

A handle to the animator is needed and only when the player is detection the animator should be disabled.

[SerializeField] private Animator _animator;private void OnTriggerEnter(Collider other)
{
_animator.enabled = false;
StartCoroutine(StartGameOverCutscene());
}
Same clip as above but the Game view

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tristan Engel

Tristan Engel

18 Followers

Aspiring developer that’s self-learning Unity & C# to transition to a career with Unity. I got a passion for creating interactive experiences.