RaulG
1
The EXACT mousePos.
The one I currently have is off by a bit which makes it difficult to do things:
Vector3 mousePos = Input.mousePosition;
mousePos.Normalize();
Ray HookRay = new Ray(HookChild.position,mousePos);
Debug.DrawRay(HookRay.origin,HookRay.direction,Color.blue);
If you are looking to create a ray, you should use Camera.ScreenPointToRay().
Ray HookRay = Camera.main.ScreePointToRay(Input.mousePosition);
Debug.DrawRay(HookRay.origin,HookRay.direction,Color.blue);
This will create a ray into the scene at the mouse position starting at the camera’s near clip plane.