Saturday, 16 April 2016
Craig Lang - Checkpoint Scripts
I decided to create checkpoints within the game. I feel this is an important feature to include as the game can be challenging at points. It also helps the player feel a sense of achievement within the game. I created a box collider and using the same transform script I used for the spawn script I simply transformed the spawn box position to the Checkpoint trigger. This transform the spawn trigger to the checkpoint allowing the player to spawn in the new position.
I tried duplicating the checkpoint and positioning them around the map. However, this caused issues as the spawn trigger will always move to the very last trigger. I tried adding all objects to selecting them one at a time with the same script, but the issue wasn't solved.
I therefore created separate scripts for each trigger and called them inside one another. I then activated and deactivated them in order script by script as the player progresses through each checkpoint. This allows the spawn trigger to transform to the last checkpoint trigger the player entered.
Labels:
Craig Lang,
Scripting,
Unity
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment