Readying Level Greyboxing

To test and greybox the levels I had planned, I had to first set up a few systems:

  • Camera Actvation
  • Respawn Functionality
  • Room Locking

Room Trigger

To do this I created a Room Trigger that would check if the player entered a specific room, if the player did, the room trigger would:

  • Activate the Room Lock (Preventing the player from backtracking)
  • Increase priority of the room-specific camera
  • Set a respawn point transform

Camera Functionality

The Room Trigger first checks for the player, and if the player is in the room it called a ActivateRoomCamera() method:

Which, with the help of Cinemachine, allows me to change the priority value of a camera, making it the active camera in the scene.

Respawn Functionality

For the respawn point to work, the room trigger calls a method inside of my Scene controller singleton.

This Scene controller would store this respawnpoint’s position:

Then if the player dies:

Scene controller would call a method that reloads the current scene:

And the playercontroller script would check if the scenecontroller’s hasCustomRespawn bool returns true, if it does it spawns the player at the specified respawn.position:

Leave a Reply

Your email address will not be published. Required fields are marked *