Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Moving A Ray Relative To Parent, Not World

$
0
0
How can I make it so the ray starts a certain distance away from the front of an object. So when the object rotates, the ray start point stays in the same relative position to the object. var ray = new Ray(transform.localPosition + Vector3.forward * 10, transform.TransformDirection(Vector3.forward)); That was my attempt. But it only moves it based on a global axis. Thanks for you time, Magnus :)

Viewing all articles
Browse latest Browse all 171066

Latest Images

Trending Articles



Latest Images

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