Skills Bootcamp

First Person Controller & Gun Script

We made a first person controller script and attached it to a capsule, parenting the camera to the top of it to give the correct perspective. Using a prefab sphere we created a bullet and attached it to a gun script on the camera. This spawned small bullet like objects on click appearing from around the players position.

The blocks were given an enemy script wherein, on collision with the bullet, it would change color from white to red and eventually be destroyed.