Get cells on the path

  • July 10, 2017 at 15:28 #21297
    exltus
    Participant

    Is there any way how to get all cells allong the generated path?

    July 11, 2017 at 10:14 #21309
    Rami
    Keymaster

    Hi Exltus,

    Thanks for your post.

    There is no built-in way to get all the cells along the path. However, you can relatively easily get them yourself by sampling.

    The path response you get for requesting a path will consist of an array of positions (Vector3s). Simply start at one and sample towards the next one, stepping one cell size per iteration.

    July 14, 2017 at 12:08 #21362
    Geminior
    Keymaster

    You can also turn off path smoothing. If you do the path will not prune adjacent nodes, so the path will consist of every node on the way.

    You can also combine the two by having a look at the path smoother and adjusting it to your needs.

You must be logged in to reply to this topic.