3rd crosshair raycast

Hi, I have a problem here.
I am doing a 3rd person view with crosshair in the middle of the screen and the player under the crosshair. The mouse cursor is locked.

I uses Physics.Raycast to detect the point where the crosshair is pointing. (RaycastHit.point) which is Vector3.

So, how do I code in a way that the rocket is shooting and moving towards that position?..

I don’t know if i fully understand, but it seems that you want to do this

(put this in the rocket)

function update()
{
    transform.LookAt(crosshairTarget);
    transform.Translate(0,0, rocketSpeed*Time.deltaTime)
}

if you want to get the point where the crosshair is pointing you would want to use raycasts, if so tell me and i’ll post a code for it

Thanks. i will try it.

how can I find out where the Crosshair is pointing??? Iam trying it for hours now, but Raycasts are not explaint very well and hard to understand in my opinion :confused:

Check out this thread for an explanation and some example code.

very helpful, thx a lot!