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’s 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

Run a UiPath Job using Python (Community Edition)

AWS Mini Glossary

VS Code Extensions Must Have

Exploration of OpenDET

3 Examples of DevOps Remediation with Datadog and WayScript

EntityFrameworkCore, code-first migrations in Azure DevOps

Protecting your Rails apps with Cloudflare Access

IOT: Enchanted Pot

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

New Enemy Movement Behavior

Using Light Probes in Unity’s HDRP

Quick tip — How to set up Occlusion Culling in Unity