Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 3: Finishing the Game Loop

Challenge: Send an Event to the TreasureController to Reset the Game

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

Your next challenge is to use the onCollisionEnter function in the ButtonScript to send an event to the TreasureControllerScript to reset the game.

  • Get an EntityRef for TreasureController in the ButtonScript
  • Use the onCollisionEnter function to determine when you should send the event.
  • Get the Entity associated with the EntityRef, and check that it is not null.
  • Send an event to that Entity with a string that matches the function on the TreasureControllerScript, resetGame.