From cecade76774f0e5348041103661bd12aeda7d85e Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 3 Apr 2026 21:24:27 -0700 Subject: [PATCH] Make PTATCAM track spectator ROI instead of camera in ScenePlayer --- .../src/multiplayer/animation/sceneplayer.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/extensions/src/multiplayer/animation/sceneplayer.cpp b/extensions/src/multiplayer/animation/sceneplayer.cpp index c22e200b..ed2f5e4a 100644 --- a/extensions/src/multiplayer/animation/sceneplayer.cpp +++ b/extensions/src/multiplayer/animation/sceneplayer.cpp @@ -421,8 +421,17 @@ void ScenePlayer::ApplyPtAtCam() return; } - LegoWorld* world = CurrentWorld(); - if (!world || !world->GetCameraController()) { + // Find the spectator participant — PTATCAM tracks the spectator's position + // instead of the camera so the actor faces the same target for all players. + LegoROI* spectatorROI = nullptr; + for (const auto& p : m_participants) { + if (p.IsSpectator() && p.roi) { + spectatorROI = p.roi; + break; + } + } + + if (!spectatorROI) { return; } @@ -444,7 +453,7 @@ void ScenePlayer::ApplyPtAtCam() float upsqr = sqrt(up.LenSquared()); up = und; - up -= world->GetCameraController()->GetWorldLocation(); + up -= spectatorROI->GetWorldPosition(); dir /= dirsqr; pos.EqualsCross(dir, up); pos.Unitize();