Search Unity

easy question unless ur new to all this.... (moving)

Discussion in 'Navigation' started by Builder_Bob99, Apr 28, 2020.

  1. Builder_Bob99

    Builder_Bob99

    Joined:
    Apr 28, 2020
    Posts:
    1
    ok..
    Pls note that I take a BASE position from my "player agent", but the agent is not moved.

    so i have my Agent and to find the surface in front of me, I use ray tracing..... to find the exact collision point.
    (since it is not a flat surface)

    Now what i want to do is add an offset to that in the direction i'm looking, (currently for testing )
    I'm using....
    Code (CSharp):
    1.  
    2. basepos.x += 1f;
    3. basepos.z += 1f;
    4.  
    I iterate round a loop,which lays down a "straight line".. along a path but clearly not always in the direction i'm looking .(but my items ARE nicely following the contours of the surface)


    I think i can get my "looking" direction from
    Code (CSharp):
    1. ray.direction
    but how do I generate a new position to test ?, how do i "sum" vectors in space?