Answers for "unity get ray hit position"

C#
2

unity ray from mouse position

RaycastHit hit;
Ray ray = camera.ScreenPointToRay(Input.mousePosition);

if (Physics.Raycast(ray, out hit)) {
  Transform objectHit = hit.transform;

  // Do something with the object that was hit by the raycast.
}
Posted by: Guest on August-04-2020
-2

get raycast hit position

RaycastHit.point
Posted by: Guest on May-10-2020

C# Answers by Framework

Browse Popular Code Answers by Language