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

`````` 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)

set_process(true)
``````

Note:
uiup is forward movement
ui
down is backward movement

in Engine
edited

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.

``````    extends Spatial

var h = ("hovercraft")

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"):