Quantcast
Channel: Questions in topic: "drawray"
Viewing all articles
Browse latest Browse all 92

Vector direction to point

$
0
0
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

Viewing all articles
Browse latest Browse all 92

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>