Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 3: Finishing the Game Loop

Find an Entity Using a Tag

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

Now that we have a tag on our entity, we can find it from any script using that tag. We’ll get a list of all the entities that match the tag using this.game.findEntitiesByTag

  1. In TreasureControllerScript, delete the tick function.
  2. Below the start function, create a new function called randomizeTreasure.
  3. Make a new variable called digSpots.

Assign that variable to whatever the game finds when using getEntitiesByTag