mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 14:10:55 +03:00
Use InputEventMouseMotion.screen_relative where relevant in all demos (#1232)
This provides mouse sensitivity that is independent of the viewport size, without needing to query for project settings. This also inverts the mouse motion direction in the 3D navigation demo to better match expectations, and increases mouse sensitivity in the Window Management demo to be closer to other demos.
This commit is contained in:
@@ -20,7 +20,7 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
return
|
||||
|
||||
if event is InputEventMouseMotion:
|
||||
var rotation_delta: float = event.relative.x
|
||||
var rotation_delta: float = event.screen_relative.x
|
||||
_rotation_pivot.rotate(Vector3.UP, -rotation_delta * ROTATION_COEFF)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user