Create a Security Camera System in Unity

Mike Brisson
3 min readJun 9, 2021

--

In order to create a security camera system, we first need a camera. You can create a low-poly version in unity simply using some simple shapes or you can create your own using some 3D software such as Blender.

With a camera in place, it’s time to setup an object that will act as our camera’s vision. Here I’ll use a simple cube to represent the camera ‘cone’:

With our camera’s ‘vision’ in added, we need to make sure that the collider is set to “trigger” and has a rigidbody component added:

In order to give the camera sight a greenish hue, we can create a transparent material:

We can apply the new material to see our progress:

Next up we need to animate the camera. First, make sure the “Vision” object is a child of the camera. Then with the Camera selected, open up the animation window and select “Create”:

This will create both an animation controller and an empty animation. Next we can move the playhead to the zero position, the camera to it’s start rotation, and press record.

While the animation is recording, move the playhead up and make another rotation. You’ll notice that new keyframes are automatically added when you adjust the camera.

When you are happy with the result, click the record button again to finish the animation:

Now we just need to check if the vision trigger collides with something like the player in a script that is attached to the vision object:

--

--