diff --git a/Assets/Scripts/Network/UI/PlayerNameplates.cs b/Assets/Scripts/Network/UI/PlayerNameplates.cs index 7883cf2..4334e4e 100644 --- a/Assets/Scripts/Network/UI/PlayerNameplates.cs +++ b/Assets/Scripts/Network/UI/PlayerNameplates.cs @@ -7,9 +7,10 @@ using UnityEngine; /// projected above the head via Camera.main each LateUpdate - NOT world-space, so names always draw over the /// scene and (via this canvas's sortingOrder) over the normal HUD. No GraphicRaycaster and every label is /// raycastTarget=false, so it never eats clicks. Font size scales inversely with camera distance, clamped to -/// [minFontSize, maxFontSize]. The OWN avatar's label is gated on its body being locally rendered - the exact -/// proxy for "not first-person" (the FP controller self-hides the mesh, including while Esc-paused). -/// Per-role/phase visibility (hide phase etc.) is deliberately not applied yet. +/// [minFontSize, maxFontSize]. Visibility: a label shows only while its avatar's body is rendered locally +/// (own first-person self-hide, the per-client hide-phase matrix, found hiders, paint-reveal gate - a name +/// floating over an invisible body would leak the position), and hider names are additionally suppressed for +/// a local HUNTER viewer during Seek, where bodies ARE rendered but a label would defeat the camouflage hunt. /// [DisallowMultipleComponent] public class PlayerNameplates : MonoBehaviour @@ -63,6 +64,12 @@ public class PlayerNameplates : MonoBehaviour } var cam = Camera.main; + // Seek is the one window where a hider's body is rendered for a hunter but its name must not be + // (spotting the camouflage IS the game); everywhere else the body-rendered gate below suffices. + var match = MatchManager.Instance; + bool hunterSeek = match && match.LocalSubPhase == MatchManager.MatchSubPhase.Seek && + NetworkPlayerSetup.LocalViewerIsHunter(); + for (int i = 0; i < _entries.Count; i++) { Entry e = _entries[i]; @@ -70,8 +77,12 @@ public class PlayerNameplates : MonoBehaviour bool show = cam; - // Own avatar: label only while the body is rendered locally (hidden = first person / load freeze). - if (show && e.setup.IsOwner && (!e.body || !e.body.enabled)) + // Label only while the body is rendered locally: covers the own first-person self-hide AND every + // per-client hide (hide-phase matrix, found hiders, paint-reveal/conversion gates) in one check. + if (show && (!e.body || !e.body.enabled)) + show = false; + + if (show && hunterSeek && e.setup.Role == PlayerRole.Hider) show = false; Vector3 screen = default;