Search Unity

X Spot Treasure Map

Discussion in 'Getting Started' started by ZioBasi, Feb 6, 2021.

  1. ZioBasi

    ZioBasi

    Joined:
    May 8, 2018
    Posts:
    33
    Hi guys,

    I was wondering what I should do to make a map which shows an X spot (of a pirate chest for example) and if a player goes there and dig, something comes out of the ground.

    What I mean is I know how to make a map with program like Photoshop, but I'm missing two things:

    1) how to generate random X everytime a player gets a new map

    2) how to match that X shown on the map to the terrain of the level

    Thanks for your help
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Just layer the X on top of the map image. For example, if you're displaying all this in a Canvas, then just add a separate Image for the X.

    Use math to calculate where in the world you want your treasure, and what spot that corresponds to on the map. Position your Image there.
     
    ZioBasi likes this.
  3. ZioBasi

    ZioBasi

    Joined:
    May 8, 2018
    Posts:
    33
    Thanks a lot! This is really helpfull!