Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Getting players coverage of a map

Discussion in 'Scripting' started by vojtechcahlik, Sep 17, 2020.

  1. vojtechcahlik

    vojtechcahlik

    Joined:
    Jun 3, 2020
    Posts:
    6
    Hello guys,

    I had a question regarding how to approach a problem I have.

    Lets say I have a map and I want to track where player already has been. So the ground underneath the player would change color/texture. I will also need to check what percentage of that ground player already covered.

    Im quite new to Unity. I had an idea to have vertex shader material on high topo terrain and then changing vertices closest to the player. I am not sure if then I can count vertices player already repainted.

    Not really sure how to approach it so any advice or suggestions for better approach would be greatly appreciated!

    Thank you.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    It mostly comes down to how tightly you want to show it, ranging from individual pixels (or footsteps) where the player has been (which could add up to a LOT of data), to dividing the world into larger chunks and just flagging them (much less data).

    The representation of this data depends utterly on the answer to the above, and then your visualization can take whatever form is appropriate for whatever current visualization you are using.
     
    Joe-Censored likes this.
  3. vojtechcahlik

    vojtechcahlik

    Joined:
    Jun 3, 2020
    Posts:
    6
    Thank you for answering.

    The best case scenario is showing exact path of a player. The vertex paint one is not ideal for this but it was the only one I managed to figure out.

    I did a quick sketch for better understanding of what I am trying to achieve.