I’ve been busting my brains the whole morning trying to figure this one out, searching for an answer and now, since time is passing and I did nothing, decided to ask here.
I’m working on a first person space shooter. A simulation of piloting in space with real space physics.
The issue is that I would very much like to have my spaceship turrets fire in a direction I’m pointing with a mouse, but mouse is free, not fixed to a center of the screen. So I guess it would be best if I added an empty game object to follow the mouse at a certain distance and aim turrets towards it. But since there is nothing for a raycast to hit, and I would like to avoid a giant transparent plane in front of a camera, I have no idea whatsoever how to do this.
@mhaddon: I guess Camera.ViewportToWorldPoint could lead to translating Vector2 mouse position to a Vector3 an than pushing that position to a certain distance from the camera/player and then translating the empty game object to that position.