Creating Functional Security Cameras (Game Dev Day 63)
With the guards all finished up, I moved onto the two security cameras in the back of the level.
First, I used Unity’s Animator to make them pan back and forth
Changing the speed on the “Reverse” animation just runs the animation backwards. This creates a permanent loop effect.
To make them “detect” the player, I used the same method as the guards’ “eyesight”; giving the green cone a collider and detecting the player through tags. The script then changes the camera’s color to red, freezes the camera (so it looks locked onto the player) and then after a half second delay, plays the Game Over cutscene.