I am wondering if there is a function or variable that is the mouses direction from the camera through the world. I need it for a phaser to were ever the mouse collides with a collider.
thanks.
I am wondering if there is a function or variable that is the mouses direction from the camera through the world. I need it for a phaser to were ever the mouse collides with a collider.
thanks.
Sure:
Camera.main.ScreenPointToRay(Input.mousePosition).direction
is the world-space direction from the camera to the mouse pointer.
thanks :D :D :D :D :D
– saberboy117If it's working for you, could you hit the 'tick' button next to this answer, please? :-)
– superpig