Hi,
I’m looking for some information on scripting a visible line or pathway to a waypoint, like in GPS systems. Can anyone point me in the right direction?
Thankyou in advance!
EM
Hi,
I’m looking for some information on scripting a visible line or pathway to a waypoint, like in GPS systems. Can anyone point me in the right direction?
Thankyou in advance!
EM
is this a straight line from point A to B or is it supposed to follow along a road or something (Like satnav)
Straightline A to B, although I was thinking of doing obstacle avoidance at some point.
you can get a straight line from A to B like this:
Vector3 directionAtoB = ObjectB.position - ObjectA.position;
Have a look here:
http://forum.unity3d.com/threads/221938-Find-midpoint-between-2-game-objects-C
Then you could use a line renderer to draw a line between them
Very very simple! Thank you. It should be possible to attach a rectangular 2D GameObject or box to this line correct?
Not sure, I only used a line renderer once for a laser beam.
You should be able to position any gameobject along the line once you have the line vector.