Scale third-person orbit zoom range and default by player size
The orbit radius (min/max/default and per-notch step) was in absolute world units and ignored the player's localScale, so a small Hider started too far out and a large Hunter too close and could not zoom out far enough. Multiply range, step and default radius by the follow target's lossyScale (PlayerScaler keeps the body uniformly scaled), making the inspector fields size-1 design values that frame every role body-relative. Re-clamp every frame so a runtime grow/shrink stays in range. GameModeManager.BindLocalPlayer calls ResetZoom after rebinding so each new avatar starts at its scaled default zoom. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
0834419a56
commit
62cf0eae04
2 files changed
+58
-8
No files matched your search
@@ -194,7 +194,15 @@ public class GameModeManager : MonoBehaviour
|
||||
if (cameraInput)
|
||||
{
|
||||
var vcam = cameraInput.GetComponent<CinemachineCamera>();
|
||||
if (vcam) { vcam.Follow = camTarget; vcam.LookAt = camTarget; }
|
||||
if (vcam)
|
||||
{
|
||||
vcam.Follow = camTarget;
|
||||
vcam.LookAt = camTarget;
|
||||
// Follow is now the new avatar's target, so its lossyScale is live - start the camera at this
|
||||
// avatar's scaled default zoom (Hider pulls in, Hunter pushes out) instead of inheriting the
|
||||
// previous avatar's radius.
|
||||
cameraInput.ResetZoom();
|
||||
}
|
||||
}
|
||||
|
||||
if (firstPerson)
|
||||
|
||||
Reference in new issue
Block a user