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!!!
↧