Victor
10/12/2019 - 11:52 PM

GetMouse position in SceneView Unity Editor

public Vector3 GetPointInWorldSpace()
{
    Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
    RaycastHit hit;

    if (Physics.Raycast(ray, out hit))
    {
        return hit.point;
    }

    return Vector3.zero;
}