Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | steffenkre | |
Old Version | Published before Godot 3 was released. |
Whats the ‘best’ way to move a character in 3D space. I have a Player Noder (Rigidbody, Mode: Character) and want it to make move forward(depending on its rotation), rotating and jumping.
My first naive attemp was:
extends RigidBody
export var rotspeet = 1.0
export var movespeed = 1.0
func _ready():
# Called every time the node is added to the scene.
# Initialization here
set_process(true)
func _process(delta):
if Input.is_action_pressed("ui_right"):
self.rotate_y(rotspeet*delta)
if Input.is_action_pressed("ui_left"):
self.rotate_y(rotspeet*delta*-1.0)
if Input.is_action_pressed("ui_up"):
self.translate(Vector3(movespeed*delta, 0.0, 0.0 ) )
but the physic simulation stops while rotating/translating. So, whats the best way to move arround in 3D?