Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 3: Finishing the Game Loop

Make a Function on the Treasure Controller to Reset the Whole Game

You don’t have access to this lesson
Please register or sign in to access the course content.

Next, we’ll make a function for the TreasureControllerScript to reset the game, and let it send a signal to the chest to reset itself. 

  1. Give the TreasureControllerScript an EntityRef for the Chest-Bottom entity.
  2. Create a new function called resetGame
  3. Create a new variable for the chest, using get on the chestRef
  4. Check that the chest  is not null.
  5. Send an event to the chest with “reset”.