From 2ce58f86aa74f1fd904690cb3ba3438bee4b765f Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 8 Feb 2024 21:49:04 -0500 Subject: start spin, not in ground --- racing/player.gd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 racing/player.gd (limited to 'racing/player.gd') diff --git a/racing/player.gd b/racing/player.gd new file mode 100644 index 0000000..95220c1 --- /dev/null +++ b/racing/player.gd @@ -0,0 +1,19 @@ +extends "res://scripts/player.gd" + + +func _unhandled_input(event): + ._unhandled_input(event) + + # Checks specifically for *not* playable. On purpose. + if event is InputEventMouseMotion and !playable and !solving: + rotate_y(-event.relative.x * mouse_sensitivity) + if global.invert_y_axis: + pivot.rotate_x(event.relative.y * mouse_sensitivity) + else: + pivot.rotate_x(-event.relative.y * mouse_sensitivity) + pivot.rotation.x = clamp(pivot.rotation.x, -1.5, 1.5) + + +func _solving(): + if playable: + ._solving() -- cgit 1.4.1