I need to do a raycast from the position of the camera and a direction so that the raycast hits exactly what is under the mouse.
Get camera world space direction.
Get mouse position in world space.
Use those 2 as parameters for they raycast. That should work.
how do i get the muse position in world space
Camera.ScreenPointToRay:
This does exactly what you want. Cast with this ray and you get what’s directly under the mouse.
this is good but how do i get mouse coordinates?
Input.mousePosition
srsly bro, google
sorry, looked in Input just didn’t catch it