Browse Source

:beetle: Fix walk speed control

DricomDragon 1 year ago
parent
commit
0579930e5f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      godot/component/entity/walker/walker.gd

+ 1 - 1
godot/component/entity/walker/walker.gd

@@ -42,7 +42,7 @@ func trigger_direction(dir: Vector2) -> void:
 	var camera_basis: Basis = get_viewport().get_camera_3d().get_camera_transform().basis
 	var target_world_direction: Vector3 = camera_basis * target_character_direction
 	target_world_direction.y = 0.0
-	var target_walk_velocity = target_world_direction.normalized() * speed
+	var target_walk_velocity = target_world_direction.normalized() * speed * dir.length()
 
 	target_velocity.x = target_walk_velocity.x
 	target_velocity.z = target_walk_velocity.z