- # Get the XZ input direction based on player's input relative to the camera
- var forward := camera.global_basis.z
- var right := camera.global_basis.x
- var movement_direction := (
- forward * input.movement_direction.y + right * input.movement_direction.x
- ).normalized()