Improved camera

This commit is contained in:
2024-02-10 00:10:51 +01:00
parent c3812dd54e
commit da869e0185
10 changed files with 194 additions and 114 deletions

View File

@ -17,7 +17,7 @@ func _unhandled_input(event):
# Calculate the direction
var move := Input.get_vector("move_left", "move_right", "move_forward", "move_backward")
var direction := (Global.camera.transform.basis * Vector3(move.x, 0, move.y))
var direction := (Global.camera.global_basis * Vector3(move.x, 0, move.y))
direction.y = 0
direction = direction.normalized()