Help with a player controller for a top down 3d space game

Godot Version

v4.7.stable.official [5b4e0cb0f]

Hey there. I’m pretty new to godot, followed a few tutorials and made a very simple click game. Right now I’m trying to find a tutorial on a top down 3d space game. All I’m finding is 2d top down space games. Can someone help with finding a tutorial or a basic controller that can do what I would like?

What I would like:

  • Ship faces the mouse position
  • Camera should follow the ship, but not rotate.
  • Ship moves forward/backwards and can strafe left/right

Thanks.

EDIT

After some tinkering and searching I got this, which seems to work.

var mouse_vector = Vector3(get_viewport().get_mouse_position().x - get_viewport().size.x / 2, 0, get_viewport().get_mouse_position().y - get_viewport().size.y / 2)
look_at(mouse_vector)
1 Like