The Great Fleece: Security Cameras, Part 2

Brian Branch
2 min readAug 13, 2021

This article will be setting up the security cameras to detect Darren when he comes within their range.

Under each of the cameras under Camera > Camera_1 there is an object named CameraCone. These have a Convex Mesh Collider, which we can use to detect Darren using OnTriggerEnter.

To get this started, I’ll create a script named SecurityCamera and place it on both CameraCone objects.

The script is almost exactly like the one used previously for the guards to detect Darren.

Now when Darren walks through the detection range of the cameras, it triggers the Game Over Cutscene.

If you look carefully, the only problem is that you can actually see the Player Darren model in the cutscene. Luckily this is easy to fix. Just select and enable the Game_Over_Cutscene, then open the Timeline window. In the Timeline, window click the + sign and select Activation Track. Then drag the Player Gameobject into the spot needing a GameObject.

Next, drag the Active bar for the Player over to the end of the animation and shrink it to only be on the last frame. This will deactivate the Player GameObject until the last frame, when the cutscene has ended.

And that sets up Darren to get caught by the security cameras if he isn’t careful.

I hope you enjoyed this article and found it informative. And as always, until next time, I wish you well on your coding and game development journey.

--

--