Godot Version
4.3
Question
I’ve set up a movement system that I use between my player character and an air-ship, which in godot is a CharacterBody3D.
its set to MotionMode Floating.
Now to my Problem, moving Forward/Back, Left/Right and Rotation is working perfectly, i can also float down but Up wont do a thing, despite the editor showing the velocity being changed correctly.
Any ideas on what i can do to fix this / might be doing wrong?
here’s the relevant Code:
extends CharacterBody3D
signal exitShip
const SPEED = 300
var shipMove: bool = false
#var input: Vector3
#var inputUi: Vector3
var shipMovement: Vector3func _physics_process(delta):
#region MOVE n’ROTATE
if(shipMove == true):
var input_ui = Input.get_vector(“ui_down”, “ui_up”, “ui_left”, “ui_right”) #arrow keys
var input_dir = Input.get_vector(“up”, “down”, “right”, “left”) #WASD
var direction = (transform.basis * Vector3(input_dir.x, input_ui.x, input_dir.y)).normalized()
shipMovement = Vector3(direction.x, direction.y, direction.z)
print(direction)
rotation.y -= input_ui.y * delta * (5)if direction: velocity = shipMovement * SPEED * delta else: velocity = Vector3(0, 0, 0) print("x ", velocity.x) print("z ", velocity.z) print("y ", velocity.y) move_and_slide()
#endregion