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.
- Give the TreasureControllerScript an EntityRef for the Chest-Bottom entity.
- Create a new function called resetGame
- Create a new variable for the chest, using get on the chestRef
- Check that the chest is not null.
- Send an event to the chest with “reset”.