I just started prototyping a 3D rail shooter a few days ago. Before dealing with collisions I wanted to get the perfect control for the flying vehicle. I ended up with a KinematicBody, which rotates in three axes. It works goes like this:

1 - rotate each axis according to the mapped keys code: (...) if (compass == 8): #I map directions according to the numpad numbers (...) if (value_z > -20): ship.rotate_z(deg2rad(1.4))

2 - translate the body to the direction it points. code: (...) if (thrust): ship.translate(Vector3(delta*accel2,0,0))

I got to the point where the motion is neat and fluid, however... I forgot that when you translate a kinematicbody it doesn't respect collisions. What I'd like to know:

How to achieve the same effect of translating it to the facing direction, using the move() method (so it'll take collisions into account.). Can I move in the facing direction?

I thank you guys in advance.

I suggest you to get the vector3 facing_direction = get_transform().basis.x ( or z, it depends of your spaceship scene, look his gizmo or rotate the node) it gives you a local direction. You can put it as an argument of move(): move(facing_direction * speed). I hope I have understood the question.

Thank you very much, NeoD. That's exactly what I was looking for :)

6 years later