Sync mesh lean offset and disable concealment meter on remote avatars

Replicate the composed wall-lean/ground-raise/ceiling-lean mesh offset
(meshOffsetTarget.localPosition) as an owner-authoritative NetworkVariable
so remote avatars lean and raise instead of staying rigid; remote eases it
onto the visual root. Disable ConcealmentMeter on remotes (its per-frame
skinned bake, voxelization and physics overlaps only feed the local player).
SkinnedColliderBaker stays active on remotes because the paint replay
rasterizes its live BakedMesh for UV mapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-27 15:59:25 +02:00
1 parent ae84bb99dd
commit eedba5f0e6
2 files changed
+78 -19

No files matched your search

+11
View File
@@ -28,5 +28,16 @@ public class NetworkPlayerSetup : NetworkBehaviour
if (controller) controller.enabled = false;
var cc = GetComponent<CharacterController>();
if (cc) cc.enabled = false;
// Owner cleanup: the concealment meter is a per-frame skinned-mesh bake + voxelization +
// physics overlap whose result only feeds the LOCAL player (HUD / gameplay). A remote avatar's
// concealment is computed on its own owner's machine, so running it here is pure wasted CPU.
var concealment = GetComponentInChildren<ConcealmentMeter>(true);
if (concealment) concealment.enabled = false;
// NOTE: SkinnedColliderBaker deliberately stays ENABLED on remotes. MeshPainter's stamp replay
// (ApplyNetworkStamp -> DrawBrushGpu) rasterizes the baker's live, per-frame BakedMesh to map a
// 3D brush placement into UV space; freezing the bake would mis-map replicated paint onto any
// non-rest pose. Its bake is the necessary cost of correct remote paint, not wasted work.
}
}