How do i determine multiple points along a ray?
Thanks-
here is my original question
http://answers.unity3d.com/questions/481910/instantiate-wallfence-down-a-raycast-from-point-a.html
How do i determine multiple points along a ray?
Thanks-
here is my original question
http://answers.unity3d.com/questions/481910/instantiate-wallfence-down-a-raycast-from-point-a.html
A Ray is composed of an origin and a direction. In addition, the direction is always normalized. So the best way is to use Ray.GetPoint() which will find a point a specified distance along the ray. This is equivalent to:
var v3Pos = ray.origin + ray.direction * distance;
If you have a figurative ray (i.e. an origin and a direction but not in a Ray class instance), you can use the above formula if you make sure the direction is normalized.