Hey, this one has been stumping me for a few days now, and I keep avoiding it.
So, I’m trying to do a simple Raycast from mouse position to the world. I’m using:
Physics.Raycast( Camera.main.ScreenToWorldPoint(Input.mousePosition), Camera.main.transform.TransformDirection(Vector3.forward), mouseHitInfo ); //Cast down
Which didn’t seem to be giving me the results I was expecting, so I logged the output, and Camera.main.ScreenToWorldPoint is giving me the same position every single time. (10, 12, 3).
As a note I’m using a camera facing down, on a 30 degree angle. I am calculating that angle in the code above with TransformDirection, so I don’t see the issue…
Any help on the matter is much appreciated, and thanks in advance.
-Rob