Keep the pilot in the seat - #25
Open
beleata wants to merge 1 commit into
Open
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sitting in a pilot seat and turning the ship leaves the avatar's body floating free of the chair
while the view stays where it should. Two causes, both client side, eighteen lines in
MyPlayer.cs.The seat lock is never engaged
MyCharacterController.LockPlayerToPointalready does this job — it parents the player to a pointand eases them onto it, and
Updatedrives it every frame while_isLockedToPoint. Nothing everswitched it on. Logged once per movement message while sitting in the pilot seat:
So nothing held the body. Measured against the ship over ten seconds of turning, it drifted about
one metre and six degrees out of the chair, and eventually left the room trigger — at which point
TransitionTriggerHelpercalledExitVesseland the client wrapped the seated player in aPivot.That is where the "ejected from the ship while piloting" behaviour comes from;
ExitVesselfiredfour times in one session while
LockedToTriggerwasPilotingTrigger.It is engaged only for
SceneTriggerShipControl.LockedToTriggeris set for every interactable,and locking to all of them drags the player into displays, through hulls, and sometimes into lethal
geometry — found the hard way. Anything else releases the lock and unparents, because
LockPlayerToPoint(false)clears its own flag but leaves the parent it set, so a player who stands upotherwise stays welded to the chair.
A strapped-in player is ragdolled
MyCharacterControllerragdolls whenVector3.Angle(transform.up, -GravityDirection) > 40. Turningthe ship turns the room's gravity, while a seated player's up does not follow, so the game concludes
they have fallen over. Logged while seated:
and the skeleton stretched as it went — head to hips grew from 0.63 m to 1.08 m.
ToggleRagdollnow refuses to enable while
LockedToTrigger != null; disabling still passes, so a player who sitsdown already ragdolled is cleared normally.
Verified
Played against a local server and Nakama, on a clean world. Sitting, turning the ship hard and at
length, standing up, sitting again: the body stays in the chair,
lockedToPoint Truewith theattach point set,
ragdoll False, and the skeleton distances hold to the millimetre. Displays andpanels behave as before.
Ship controls themselves are still wrong — the ship jumps about once a second while steering and
freezes if the input is pushed harder. Not touched here; that looks server side and is next.
Five other explanations were tried and killed by measurement before this one: the movement smoothing
constants, the anchor being allowed to rotate, the rotation being sent in the wrong frame, a detached
geometry root, and the model separating from the body. The skeleton is welded to the transform in
every sample (
modelRotVsBody (0,0,0)), so nothing comes apart inside the avatar — seeing your ownbody without a head is just the first-person head mesh being hidden from your own camera.