Detecting Player with the Security Cameras (Made with Unity)

Make cameras see the player

Rusben Guzman
Dec 17, 2021

Objective: Activate the game over cutscene when the player collides with the camera cone.

First I created a new C# Script and added it to the cameras.

Then in the camera script I declared a variable to store the reference to the game over cutscene and assigned it in the inspector. In order to detect the player I used the OnTriggerEnter function and checked if the other object had the Player tag, if it is true we can activate the game over cutscene.

And that’s it!!!! The player has to watch out for the cameras.

--

--

Rusben Guzman
Rusben Guzman

Written by Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

No responses yet