How do i convert Debug.DrawRay to LineRenderer?
var lineRenderer : LineRenderer = GetComponent(LineRenderer);
var aimEnd2 : Vector3;
aimEnd2 = (aimStart - currentTouchPos).normalized;
Debug.DrawRay (aimStart, aimEnd2*Vector3.Distance(aimStart, currentTouchPos), Color.blue);
lineRenderer.SetPosition(0, aimStart);
lineRenderer.SetPosition(1, aimEnd2*Vector3.Distance(aimStart, currentTouchPos));
That last line is not drawing Line Renderer properly. I know that's because DrawRay uses direction and LineRenderer.SetPosition is using exact point but i really get confused quickly when using vectors :)
The blue line is from DrawRay and the big one is from LineRenderer
![alt text][1]
How can i convert that direction into the exact point in space?
I hope the question isnt too confusing.
[1]: /storage/temp/2951-screenshot001.jpg
↧