Hi all. I’m trying to get a beam to go from an flying ship to the ground where the mouse is clicking. However I’m having a hard time getting the beam to go from the ship. Its a top down view so the camera is not attached to the ship so I have a problem with doing raycasts from the point of view of the ship. heres what I’ve been using
if(Input.GetMouseButtonDown(0)){
var mousePo = camera.ScreenToWorldPoint (Vector3 (Input.mousePosition.x, Input.mousePosition.y,camera.nearClipPlane));
var ray = camera.ScreenPointToRay(mousePo);
Instantiate (particle, mousePo, Quaternion.identity);
}
any idea how I can make a beam go from the ship down to the ground where the mouse is clicking? Thanks in advance!