Check out example codes for "unity ray from mouse position". It will help you in understanding the concepts better.

Code Example 1

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.
}

Learn ReactJs, React Native from akashmittal.com