Hi
I'm about to create a space-shooter-like game. The camera is behind the ship and I move
with WASD and rotate the view and the ship with the mouse. Everything works fine until now.
But to get more feeling into this, I want the front of my ship follow the mouse-cursor. So
when the mouse is in the left half of the screen, the ship should rotate to the left and "point" to
the mouse. I have honestly no idea how to do this how I want it. Everything I tried out let the
ship rotate more and more and just didnt stop. I dont know how I use a Ray within this.
I hope someone could help me out!
Well not sure I understand what you mean because if the camera is behind the ship, then presumably the ship is always pointing at the center of the screen. In that case the ship can't point at the mouse, because the camera (and therefore the apparent position of the mouse) keeps moving.
I suppose you could create a 3D cursor with a node and actually tie the mouse cursor to it's movement.
For just using the mouse to steer the ship, perhaps you could just take take the absolute mouse coordinates, subtract the center point of the display to get the offset, normalize and use that to weight your turn?
I just tried to use the current-mouse coordinates to rotate my ship, but I dont know
how to use these coordinates to compute the rotation. And if the ship has rotated
enough, it has to stop its rotation.
What do you mean with "I suppose you could create a 3D cursor with a node and actually tie the mouse cursor to it's movement."? I dont understand what to do
But thanks for an answer though