I can move diagonally just fine but when I jump while holding that direction I can't. I can jump holding any other direction just fine though.
CODE:
printt(velocity.x, velocity. y, velocity.z)
# Add the gravity.
if not is_on_floor():
if velocity.y >= 0:
velocity.y -= gravity * delta
# Handle Jump.
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = sqrt(jump_height * 2.0 * gravity)
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if Input.is_action_just_pressed("dash"):
if is_dashing != true:
is_dashing = true
else:
is_dashing = false
#region BaseMovment
if is_dashing == false:
print("Slow...")
if direction:
velocity.x = move_toward(velocity.x, direction.x * base_speed, base_ground_accel)
velocity.z = move_toward(velocity.z, direction.z * base_speed, base_ground_accel)
else:
velocity.x = move_toward(velocity.x, 0, base_ground_accel)
velocity.z = move_toward(velocity.z, 0, base_ground_accel)
#endregion```
**UPDATE:**
It appears to happen refuse to jump when using the arrow keys but WASD is fine now? I don't know what changed.