Godot Version
4.6.2
Question
I seem to be having trouble getting my character to move, this is my current script, is there something I’m doing wrong?
func _process(_delta: float):
var direction : Vector2 = Vector2.ZERO
direction = Input.get_vector("Move Left", "Move Down", "Move Right", "Move Up")
velocity = direction * move_speed * _delta
pass
func _physics_process(_delta):
move_and_slide()
Do you get any error message?
Do you have the inputs properly added to your Input Map in the project settings? Usually it’s not a good idea to have spaces in the input names.
Yes_MP
May 12, 2026, 10:19am
3
I think its because your multiplying velocity with delta, even though move_and_slide() will already multiply it by delta.
something like this can work:
func _process(_delta: float):
var direction : Vector2 = Vector2.ZERO
direction = Input.get_vector("Move Left", "Move Right", "Move Up", "Move Down")
velocity = direction * move_speed
func _physics_process(_delta):
move_and_slide()
take a look at “move_and_slide()” in the docs
1 Like