I’m using ScreenToWorldPoint to get the mouse position, then casting a ray forward. However, it doesn’t look like the ray is actually moving forward, somehow it is getting moved along the Y axis…
Any thoughts?
9039–336–$pointlaser_114.js (1.47 KB)
I’m using ScreenToWorldPoint to get the mouse position, then casting a ray forward. However, it doesn’t look like the ray is actually moving forward, somehow it is getting moved along the Y axis…
Any thoughts?
9039–336–$pointlaser_114.js (1.47 KB)
Not exactly positive what you’re trying to achieve, but I would use Camera.ScreenPointToRay (Input.mousePosition) to cast a ray from the camera to a point in space.
If you’re just trying to cast a ray straight out from the camera FPS style then use…
Physics.Raycast (transform.position, transform.TransformDirection (Vector3.fwd), RayHit)