What Rigid Body function should i use for a 3D Spaceship?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Millard

I have a 3D spaceship with a rigid body. I’m going for a control setup in which you press forward to accelerate and steer by moving the mouse. I have the following code set up:

 if Input.is_action_pressed("ui_up")
    $RigidBody. 

I’m not sure which rigid body function to use. I know I don’t want apply impulse. What should I use? (I want the spaceship to have acceleration and decceleration, and I want to have control over those values.

Thanks, :slight_smile:

:bust_in_silhouette: Reply From: Skipperro

If you don’t want to use physics build-in into RigidBody, and want to have more control over it, I would use KinematicBody instead.

You could then use functions like move_and_collide or move_and_slide to move the ship. This function also returns velocity vector, which you can store and use in next frame for stuff like smooth acceleration by running move_and_collide with velocity+acceleration.

Thanks for the answer, You may be right, I’m having a ton of trouble with RigidBody code (it doesn’t help that I’m a beginner.) I’ll try it.

Millard | 2019-11-08 17:17