CameraOrbit¶
Class ยท client scripts
CameraOrbit drives a third-person orbit camera around Subject with mouse, touch, and stick steering, zoom bounds, wall collision avoidance, and subject proximity fade. Access it through camera.CameraOrbit on the client.
Example
Subject¶
Subject is the entity the orbit camera follows, or nil when unbound.
Yaw¶
Yaw is the horizontal orbit angle around Subject, in radians.
Pitch¶
Pitch is the vertical orbit angle around Subject, in radians.
Distance¶
Distance is the target distance from Subject, in world units.
SideOffset¶
SideOffset shifts the camera laterally from Subject, in world units.
Sensitivity¶
Sensitivity scales mouse look delta applied to Yaw and Pitch.
SmoothDistance¶
SmoothDistance is the smoothed distance applied on the current frame.
SmoothSideOffset¶
SmoothSideOffset is the smoothed lateral offset applied on the current frame.
Fade¶
Fade is the proximity fade fraction applied to Subject on the current frame, from 0 (opaque) to 1 (hidden).
Clearance¶
Clearance is the distance left by a wall obstructing the camera, or 0 while nothing blocks the sightline.
PitchLimit¶
PitchLimit is the steepest pitch allowed in radians either way; 0 permits nearly 90 degrees.
PitchEase¶
PitchEase is the margin in radians before PitchLimit where stick turns ease to a stop.
FollowTime¶
FollowTime is the time constant in seconds for the focal height to trail Subject; 0 tracks rigidly.
FollowLimit¶
FollowLimit caps how far vertically the focal height can trail Subject; 0 sets no cap.
FollowLift¶
FollowLift is the vertical distance the focal trails Subject by on the current frame.
FollowSpeed¶
FollowSpeed is the current vertical velocity of the trailing focal point.
CollisionEase¶
CollisionEase is the distance over which a wall behind the camera eases it inward; 0 snaps immediately.
PitchPull¶
PitchPull is the fraction of Distance pulled inward near the upper pitch limit; 0 disables pull-in.
TouchScale¶
TouchScale multiplies touch drag look relative to mouse look; 0 uses the same scale as mouse look.
CollisionRadius¶
CollisionRadius is the sphere radius kept clear of walls when testing camera obstruction; 0 uses a thin ray.
ZoomSpeed¶
ZoomSpeed is the natural logarithm of distance growth per second during zoom motion; negative values zoom inward.
Punch¶
Punch adds pitch, yaw, and roll angles in radians to the view after orbit positioning.
PunchOffset¶
PunchOffset shifts the camera in its own frame after orbit positioning: X right, Y up, Z back.
FadeStart¶
FadeStart is the camera distance where Subject starts fading out.
FadeEnd¶
FadeEnd is the camera distance where Subject finishes fading out.
MinDistance¶
MinDistance is the closest distance the orbit camera zooms in to.
MaxDistance¶
MaxDistance is the farthest distance the orbit camera zooms out to.
SnapDistance¶
SnapDistance is the distance below which zoom snaps directly to MinDistance; 0 disables snapping.
ZoomStep¶
ZoomStep is the fraction of distance stepped per mouse wheel tick.
SmoothRate¶
SmoothRate is the exponential smoothing rate per second; 0 snaps without smoothing.
EyeHeight¶
EyeHeight is the vertical focal offset above Subject, in world units.
SpinSpeed¶
SpinSpeed is the angular speed in radians per second turned by camera spin keys.
CollisionSkin¶
CollisionSkin is the standoff margin kept off a wall hit by the camera obstruction check.
Active¶
Active drives camera Position and Rotation from the orbit rig when true; false leaves transform control to scripts.
FadeEnabled¶
FadeEnabled fades Subject when the camera moves closer than FadeStart.