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;
Same clip as above but the Game view