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
- In TreasureControllerScript, delete the tick function.
- Below the start function, create a new function called randomizeTreasure.
- Make a new variable called digSpots.
Assign that variable to whatever the game finds when using getEntitiesByTag