Freeze players during map load: kill gravity and hide own mesh

- PlayerCharacterController: GravityEnabled toggle. When off, hold
  vertical velocity at zero and skip steep-slope sliding so a frozen
  avatar neither falls nor drifts; true is byte-for-byte the old path.
- GameModeManager: during Loading, additionally disable gravity and
  hide the local body (SkinnedMesh + fur shell), re-asserted each frame
  to catch the mid-load lobby->match respawn. Restored (body shown,
  gravity on) before ActiveMode.Enter() on release to Hide.
- MatchManager: enter Loading *before* SwapScenes so still-bound lobby
  avatars are frozen before their floor unloads. Fixes the player
  falling into the void during the lobby->map scene swap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-07-06 07:55:40 +02:00
1 parent fba4780c0e
commit a2c8a2c75d
3 files changed
+74 -9

No files matched your search

+7
View File
@@ -605,6 +605,13 @@ public class MatchManager : MonoBehaviour
private IEnumerator MatchSequence(HashSet<ulong> hunterIds)
{
// Freeze everyone in Loading BEFORE unloading the lobby: the lobby floor vanishes a moment before the
// map's is loaded, so the still-bound lobby avatars would otherwise drop into the void during the swap.
// Loading gates movement, gravity AND the local own-body mesh on every client (see GameModeManager); the
// readiness barrier below (BeginLoadingBarrierServer re-asserts Loading) holds that hold until every
// client has the map + all match avatars ready, then Hide releases it.
SetPhaseServer(MatchSubPhase.Loading, 0f);
yield return SwapScenes(lobbySceneName, matchSceneName);
RespawnAll(id => hunterIds.Contains(id) ? hunterPrefab : hiderPrefab, matchSpawnCenter);