From dcc17b05b1bb6378f9a7e339bce1975b3ad341e6 Mon Sep 17 00:00:00 2001 From: beleata Date: Sun, 30 Aug 2026 21:22:04 +0300 Subject: [PATCH] Keep the pilot in the seat Sitting down in a pilot seat and turning the ship left the avatar's body floating free of the chair while the view stayed put. Two causes, both here. The seat lock was never engaged. MyCharacterController.LockPlayerToPoint already does exactly this job - it parents the player to a point and eases them onto it, driven every frame from Update - but nothing ever switched it on. Measured while seated: lockedToPoint False, attachPoint none, trigger PilotingTrigger. Nothing was holding the body at all, so it drifted about a metre and six degrees out of the chair over ten seconds of turning, and eventually left the room trigger, after which the client declared the player had left the vessel and wrapped them in a Pivot. It is engaged only for SceneTriggerShipControl. LockedToTrigger is set for every interactable, so locking to all of them drags the player into displays, through hulls and occasionally into lethal geometry. Anything else releases the lock and unparents, because LockPlayerToPoint(false) clears its own flag but leaves the parent it set. A strapped-in player was also being ragdolled. The controller ragdolls when the angle between the player's up and gravity passes forty degrees; turning the ship turns the room's gravity while a seated player's up does not follow, so the game decides they have fallen over. Measured: ragdoll True while locked to PilotingTrigger, with the skeleton stretched - head to hips went from 0.63 m to 1.08 m. ToggleRagdoll now refuses to enable while locked to a trigger. Ship controls themselves are still wrong and are not touched here. Co-Authored-By: Claude Opus 5 --- .../Scripts/ZeroGravity/Objects/MyPlayer.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Client/Assets/Scripts/ZeroGravity/Objects/MyPlayer.cs b/Client/Assets/Scripts/ZeroGravity/Objects/MyPlayer.cs index ad7f327a..90cf0573 100644 --- a/Client/Assets/Scripts/ZeroGravity/Objects/MyPlayer.cs +++ b/Client/Assets/Scripts/ZeroGravity/Objects/MyPlayer.cs @@ -306,6 +306,19 @@ public override BaseSceneTrigger LockedToTrigger } base.LockedToTrigger = value; + + if (FpsController != null) + { + if (value is SceneTriggerShipControl) + { + FpsController.LockPlayerToPoint(locked: true, value.transform); + } + else + { + FpsController.LockPlayerToPoint(locked: false); + transform.SetParent(null, worldPositionStays: true); + } + } } } @@ -2945,6 +2958,11 @@ public void SetMyRoomTrigger(SpaceObjectVessel vessel) public void ToggleRagdoll(bool? enabled = null) { + if (LockedToTrigger != null && (enabled ?? !_isRagdolled)) + { + return; + } + if (enabled.HasValue) { _isRagdolled = enabled.Value;