Detecting Player with the Security Cameras (Made with Unity)

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鈥檚 it!!!! The player has to watch out for the cameras.

--

--

--

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

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

Recommended from Medium

Deploying Your First PHP Application to Kubernetes Using Cloud Foundry

Documenting acceptance criteria as individual scenarios

Failure Detection: The Phi Accrual Failure Detector

A Services Oriented Architecture for Internal Tools

New Kafka Tier, No Kafka Tears

Online Programming Assignment help for Students

My Funny Story with The Em-Dash

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
Rusben Guzman

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.

More from Medium

Getting Started with Terrain Tools in Unity Part 2: Textures and Trees

2D Mobile: Setting Up The Player

2.5D Platformer鈥娾斺奍mproving the Ledge Grab #10