-# Get the XZ input direction based on player's input relative to the camera
-func get_player_input_relative_to_camera(raw_input: Vector2) -> Vector3:
- if camera:
- var forward := camera.global_basis.z
- var right := camera.global_basis.x
- var dir := (
- forward * raw_input.y + right * raw_input.x
- ).normalized()
- return dir
- else:
- return Vector3.ZERO
+ if event is InputEventMouseMotion:
+ camera_input_method = CameraInput.MOUSE
+ camera_input_direction = event.screen_relative
+ elif event is InputEventJoypadMotion:
+ # TODO: add these settings!
+ camera_input_method = CameraInput.JOYSTICK
+ camera_input_direction = Input.get_vector(
+ "camera-left", "camera-right", "camera-up", "camera-down"
+ )