Search Unity

Tracing where a user character has been.

Discussion in 'Scripting' started by elpuerco63, Sep 18, 2017.

  1. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    I'm not sure if that is the correct way to ask the question?

    But what I am trying to do is have a player in a room, say 10m x 10m where the user can move the player wherever they want. At the end of a given period (to be determined) I would like to export a tracing of the path the player took around the room.

    I know there are path tools to set for a character/player etc to move along, but I want to do the reverse, trace where they went and then record it out say to a png file to be analysed later
     
  2. Basen1

    Basen1

    Joined:
    Dec 19, 2016
    Posts:
    76
    Why not make a function, that adds the character position to a List every x seconds? A coroutine. Good luck.
     
    elpuerco63 likes this.
  3. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    Intersting! Thanks As on a plane I guess using x and y would give the plot values for the end result!
     
  4. fire7side

    fire7side

    Joined:
    Oct 15, 2012
    Posts:
    1,819
    If you have a path tool, such as astar, it gives a path for the player to follow on a grid or whatever, so you would just need to save that path each time.
     
  5. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    I already have a path tool, but that's not what I need. The user creates their own journey through the room at random and it is the random path they take I need to record.