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

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

AWS Cost Optimization

Gradients Sure Are Colorful

What are the Advantages of Using Laravel?

Boost your productivity using Markdown.

Enterprise Microservices Design [Part 1: Introduction]

Let’s create an Elevator in Unity

Android fundamentals 07.1: AsyncTask

Edge Computing 101

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

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

More from Medium

2.5D Platformer

Condition in if else give desired output in C programming | if else

my understanding of c++ inline