Raycast From Camera To Mouse Unity

[Solved] Raycast From Camera To Mouse Unity | Csharp - Code Explorer | yomemimo.com
Question : raycast from camera to mouse unity

Answered by : ugliest-unicorn-6flxfjdc0qv5

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out RaycastHit hit, 100)) {	Debug.Log(hit.transform.name);	Debug.Log("hit");
}

Source : | Last Update : Thu, 15 Jul 21

Answers related to raycast from camera to mouse unity

Code Explorer Popular Question For Csharp