[3D] KinematicBody/RigidBody flying [hovercraft-aircraft]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bishop
:warning: Old Version Published before Godot 3 was released.

Hi,
I have a script for flying object but I need to move up and down smoothly - slow/stop move? if it is possible for KinematicBody or need RigidBody?
Thanks for help

enter image description here

 extends KinematicBody

var t 
var r

export var FSpeed = 2
export var MSpeed = 2
export var RSpeed = 2

func _process(dt):
    t = get_transform()
    r = get_rotation()

    if(Input.is_action_pressed("ui_up")):
        t.origin += t.basis[2] * MSpeed * dt

    if(Input.is_action_pressed("ui_down")):
        t.origin += t.basis[2] * -MSpeed * dt

    if(Input.is_action_pressed("ui_right")):
        r += Vector3(0,-0.4,0) * RSpeed * dt

    elif(Input.is_action_pressed("ui_left")):
        r += Vector3(0,0.4,0) * RSpeed * dt

    if(Input.is_action_pressed("fly_up")):
        t.origin += t.basis[1] * FSpeed * dt

    if(Input.is_action_pressed("fly_down")):
        t.origin -= t.basis[1] * FSpeed  * dt





    set_transform(t)
    set_rotation(r)


func _ready():
    set_process(true) 

Note:
ui_up is forward movement
ui_down is backward movement

As I read the answer here somewhere, so you cannot use apply impulse for KinematicBody, which would be a solution for smooth motion (slow-stop) - impulse only for RigidBody.
Only for KinematicBody play somehow with gravity?..or am I completely off?
So the solution- RigidBody and apply the impulse(for RigidBody only)

THIS is flying script for like a hovercraft where is set apply impulse to the RigidBody (“hovercraft”) but the problem here is that when cornering to the left-right does not fly forward…I mean left-forward and right-forward.
(Sorry for my bad English)

    extends Spatial

var h = ("hovercraft")



func _ready():
	h = get_node("hovercraft")
	self.set_process(true)


#Controls
func _process(delta):
	if Input.is_action_pressed("move_up"):
		h.apply_impulse(Vector3(0, 0, 0), Vector3(0, 0.5, 0))
	if Input.is_action_pressed("move_down"):
		h.apply_impulse(Vector3(0, 0, 0), Vector3(0, -0.5, 0))
	if Input.is_action_pressed("rotate_right"):
		h.set_angular_velocity(Vector3(0,-1,0)*deg2rad(25));
	if Input.is_action_pressed("rotate_left"):
		h.set_angular_velocity(Vector3(0,1,0)*deg2rad(25));
	if Input.is_action_pressed("forward"):
		h.apply_impulse(Vector3(0, 0, 0), Vector3(0, 0, -0.2))
	if Input.is_action_pressed("brake"):
		h.apply_impulse(Vector3(0, 0, 0), Vector3(0, 0, 0.2))

Bishop | 2016-08-16 01:18