Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 3: Finishing the Game Loop

Send the DigSpot’s Position with the Event

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

Now we have code to move the chest to a position, but we aren’t giving it a position to move to yet. For this we need to return to the DigSpotScript, and send that as an additional input in the sendEvent method. 

  1. In the DigSpotScript, find the chest.sendEvent line.
  2. Add a , comma after the “startDiggingUpChestAnimation” string, and add this entity’s world position as an input.
  3. Save and test that when you walk up to the Dig Spot, the chest comes out of the ground at its position.