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

Problem With Physics.Raycast

$
0
0
Hi, I am trying to create a Ray from my MainCamera to my Player Here is the code I used... -------- var target : Transform; function Update () { Debug.DrawRay(transform.position, target.position); if (Physics.Raycast(transform.position, target.position)) { Debug.Log("Something in the way"); } } ---- Now I got it to work and all, but it doesnt seem to want to point towards the target! It points off at an angle, I need it to point directly down towards the Target. Here are a few pics to show what I mean... ![alt text][1] [1]: /storage/temp/8602-ask.jpg Any help or suggestions would be greatly appreciated!!!

Viewing all articles
Browse latest Browse all 92

Trending Articles



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