feat: change camera rotation to be always active when mouse is captured
Deploy Promiscuity Auth API / deploy (push) Successful in 1m0s
Deploy Promiscuity Character API / deploy (push) Successful in 1m1s
Deploy Promiscuity Crafting API / deploy (push) Successful in 1m0s
Deploy Promiscuity Inventory API / deploy (push) Successful in 1m0s
Deploy Promiscuity Locations API / deploy (push) Successful in 1m0s
Deploy Promiscuity Mail API / deploy (push) Successful in 1m1s
Deploy Promiscuity World API / deploy (push) Successful in 1m1s
k8s smoke test / test (push) Successful in 21s

This commit is contained in:
2026-05-12 17:19:34 -05:00
parent 2907fabe85
commit ffee63dc57
4 changed files with 17 additions and 22 deletions
+7 -11
View File
@@ -19,7 +19,6 @@ const FIREBALL_SPAWN_UP_OFFSET := 1.2
var mouse_sensitivity := 0.005
var rotation_x := 0.0
var rotation_y := 0.0
var cameraMoveMode := false
var current_number_of_jumps := 0
var _pending_mouse_delta := Vector2.ZERO
var _last_move_forward := Vector3(0, 0, 1)
@@ -86,12 +85,13 @@ func _ready() -> void:
_last_move_right = right.normalized()
_vehicle_collision_layer = collision_layer
_vehicle_collision_mask = collision_mask
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _integrate_forces(state):
if _in_vehicle:
linear_velocity = Vector3.ZERO
return
if cameraMoveMode and _pending_mouse_delta != Vector2.ZERO:
if _pending_mouse_delta != Vector2.ZERO:
rotation_x -= _pending_mouse_delta.y * mouse_sensitivity
rotation_y -= _pending_mouse_delta.x * mouse_sensitivity
rotation_x = clamp(rotation_x, deg_to_rad(-90), deg_to_rad(90)) # Prevent flipping
@@ -164,20 +164,16 @@ func _input(event):
phone_visible = !phone_visible
if phone:
phone.visible = phone_visible
if phone_visible:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
else:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
return
if _in_vehicle:
return
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_MIDDLE:
if event.pressed:
cameraMoveMode = true
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
cameraMoveMode = false
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
if event is InputEventMouseMotion and cameraMoveMode:
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
_pending_mouse_delta += event.relative
if event is InputEventMouseButton and event.pressed: