Explorar el Código

:wrench: Control all translations of player

Instead of controlling one rotation and one translation (forward /
backward).
DricomDragon hace 1 año
padre
commit
c720c2fd29

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

@@ -39,10 +39,10 @@ func trigger_jump() -> void:
 
 
 func trigger_direction(dir: Vector2) -> void:
-	target_rotation = -dir.x * turn_to_rad
-	var ground_velocity: Vector2 = Vector2.UP.rotated(-global_rotation.y) * dir.y * speed
-	target_velocity.x = ground_velocity.x
-	target_velocity.z = ground_velocity.y
+	#target_rotation = -dir.x * turn_to_rad
+	#var ground_velocity: Vector2 = Vector2.UP.rotated(-global_rotation.y) * dir.y * speed
+	target_velocity.x = dir.x * speed
+	target_velocity.z = -dir.y * speed
 
 
 ## Return true if inside a vehicle

+ 1 - 1
godot/run/levels/infinite_level.tscn

@@ -51,7 +51,7 @@ max_distance = 6.0
 camera_height = 2.0
 
 [node name="MainWalker" parent="." instance=ExtResource("1_x0026")]
-transform = Transform3D(0.701432, 0, 0.712736, 0, 1, 0, -0.712736, 0, 0.701432, -11.0852, 1.31191, -4.00841)
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.0852, 1.31191, -4.00841)
 
 [node name="Control" parent="MainWalker" instance=ExtResource("2_0i5t8")]