Godot Version
4.7.2
Question
Even though I'm using a vector3 that's normalized moving diagonally either with holding left/right and forward/backward or looking diagonally is causing movement to be faster all normalized vector lengths are 1 and the one non normalized vector's length is the max speed. Here's the code(I pasted it instead of a screenshot as there's a lot of non movement related clutter in the function)
var direction : Vector3 = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
var input_dir : Vector2 = Input.get_vector(“move_left”, “move_right”, “move_forward”, “move_backward”)
var wish_vel : Vector3 = direction * current_max_speed
wish_vel.y = velocity.y
if direction:
velocity = wish_vel
#get get_total_velocity returns: abs(velocity.x) + abs(velocity.z)
current_speed = get_total_velocity()
if current_speed < current_max_speed:
return
if !is_on_floor(): return
velocity.x = lerpf(velocity.x, wish_vel.x, 0.2)
velocity.z = lerpf(velocity.z, wish_vel.z, 0.2)