Path Visualizer

  • May 6, 2018 at 16:53 #23226
    Bartec
    Participant

    Hey,
    how to show the debug path visualizer in game?

    May 7, 2018 at 09:09 #23228
    Geminior
    Keymaster

    The Path Visualizer is a component meant for debugging, and as such it is not enabled in builds.
    You can however create your own, using the existing one as a guide.
    You will need to draw lines using e.g. a LineRenderer or GL rather than Gizmos.

    June 13, 2018 at 19:47 #23406
    Bartec
    Participant

    Hey,
    is there a way to get the length of (_unit.currentWaypoints) ?
    i want to add it to a linerenderer.

    Gizmos.color = this.waypointColor;
    if (_unit.currentWaypoints != null)
    {
    heightAdj.y = 1.0f;

    foreach (var wp in _unit.currentWaypoints)
    {
    var pinHead = wp + heightAdj;
    Gizmos.DrawLine(wp, pinHead);
    Gizmos.DrawSphere(pinHead, 0.3f);

    June 14, 2018 at 11:45 #23414
    Rami
    Keymaster

    Do you want the direct length from waypoint to waypoint summed? That should be really easy, just iterate through waypoints and accumulate the distance from one point to the next (they are just Vector3s).

    Do you want the actual real length considering obstacles? Then you may need to issue path requests from each point to the next and ask for the distance on each path result.

    • This reply was modified 1 month ago by Rami.
    June 18, 2018 at 00:02 #23437
    Bartec
    Participant

    Hey,
    not as good as i want in c#, but could you send me an example how to write this?

    cheers

    June 18, 2018 at 10:35 #23440
    Rami
    Keymaster

    Something like this:

    • This reply was modified 1 month ago by Rami.
    June 18, 2018 at 13:41 #23443
    Bartec
    Participant

    Thanks,
    not working fo me, cant ad values to linerenderer component.
    could you have a look and tell me waht im doing wrong or missing.

    June 18, 2018 at 14:25 #23445
    Rami
    Keymaster

    It seems that you are not calling the methods I provided anywhere.

    Also, you might want to not use the Visualizer base class, as that is mainly meant for debugging visualization – as also evident by the namespace (Apex.Debugging).

You must be logged in to reply to this topic.