Camera reference¶
The camera component on both pawns, and the camera director that picks the rigs.
How to read these tables
Settings are the values you tune: select the component in your pawn Blueprint (or open the asset) and look in the Details panel under the category shown. Runtime state is written by the system while it runs; read it, do not set it. Functions marked pure have no execution pins. The descriptions are the same as the Details panel tooltips. Default is the class default; where a sample pawn sets a different value on its component, the description says so ().
AC_CameraSystem¶
/GASPALS/Systems/CameraSystem/AC_CameraSystem · parent ActorComponent · implements BPI_CameraSystem_C, BPI_RagdollSystemListener_C
Settings¶
Camera > Crosshair¶
| Variable | Type | Default | Description |
|---|---|---|---|
Show CrosshairbShowCrosshair | Boolean | true | Show the crosshair dot (W_Crosshair) for the local player. When off, the dot is collapsed; aiming, cover targeting and the cover marker (bShowCoverMarker on the cover system) still work. |
Aim Trace DistanceAimTraceDistance | Float | 10000 | Length of the crosshair aim ray in cm (GetCrosshairAim), also used by cover aim. Without a hit the aim point is the ray end. Default 10000 (100 m). |
Aim Trace ChannelAimTraceChannel | ETraceTypeQuery | Visibility | Trace channel of the crosshair aim ray (GetCrosshairAim). Cover aim reads it too (AC_CoverSystem_Base.GetAimTraceSettings), so the crosshair and cover line-of-fire checks always agree. Default Visibility. |
Crosshair Widget ClassCrosshairWidgetClass | UserWidget class | W_Crosshair | Crosshair widget created for the local player and kept on the aim point. Default W_Crosshair, a plain dot in its DefaultColor. Any widget works: the camera positions it, the widget picks its own look. |
Camera > Fixed Camera¶
| Variable | Type | Default | Description |
|---|---|---|---|
Fixed Camera Mouse Aim TypeFixedCameraMouseAimType | E_FixedCameraMouseAimType | MouseTraceWithPositionFallback | Setting: how the character aims in the fixed cameras (top-down, side-scroller). MouseTraceWithPositionFallback: face the world point under the cursor, else the cursor's screen position. MouseScreenPosition: the cursor position relative to the screen center. |
Camera > General¶
| Variable | Type | Default | Description |
|---|---|---|---|
Camera StyleCameraStyle | E_CameraStyle | Style_2 | Camera style. Cycled with the style input (2), or set through the DDCVar.CameraStyle console variable. |
Is Camera Right ShoulderbIsCameraRightShoulder | Boolean | false | True when the third-person camera sits over the right shoulder. Toggled by the switch-shoulder input. |
Third Person Camera BoneThirdPersonCameraBone | Name | root | Bone or socket of the visible character mesh the camera attaches to in every perspective but first person (third person, top-down, side-scroller). Default root. |
Enable Camera SystembEnableCameraSystem | Boolean | true | Turns the camera system on or off (read at start, default only). Off: fixed third-person view with the default style, no perspective, style or shoulder input, no crosshair, no ragdoll perspective switch. The view itself (GameplayCamera, camera asset and director) stays. |
Camera > Perspective¶
| Variable | Type | Default | Description |
|---|---|---|---|
Camera PerspectiveCameraPerspective | E_CameraPerspective | ThirdPerson | Active camera mode: third person, first person, or one of the two fixed cameras (top-down, side-scroller). Sent to the server on change. (replicated) |
Allowed PerspectivesAllowedPerspectives | Array of E_CameraPerspective | ThirdPerson, TopDown, SideScroller, FirstPerson | Views this pawn offers, in perspective-key order. Default ThirdPerson, TopDown, SideScroller, FirstPerson (all). First-person only: FirstPerson. Third-person only: ThirdPerson (and remove AC_FirstPersonSystem from the pawn if you like). One entry = the perspective key does nothing. FirstPerson also needs AC_FirstPersonSystem on the pawn; first-person meshes are only built when FirstPerson is available. |
Camera > Ragdoll¶
| Variable | Type | Default | Description |
|---|---|---|---|
Allow Camera SwitchbAllowCameraSwitch | Boolean | false | Setting: when true, the perspective and shoulder inputs work while ragdolling. Looking around is never blocked. Only used when bChangePerspectiveDuringRagdoll is on. Default false. |
Change Perspective During RagdollbChangePerspectiveDuringRagdoll | Boolean | true | Setting: when true the camera switches to CameraPerspectiveDuringRagdoll while ragdolling and back afterwards. |
Camera Perspective During RagdollCameraPerspectiveDuringRagdoll | E_CameraPerspective | ThirdPerson | Setting: perspective used while ragdolling. Only applies if bChangePerspectiveDuringRagdoll is true. |
Camera > Rigs¶
| Variable | Type | Default | Description |
|---|---|---|---|
Camera Offset RigsCameraOffsetRigs | S_CameraOffsetRigs | Offset rigs the camera director layers on the main rig: crouch, right shoulder, cover low, cover edges, first-person scale, and per movement mode (in air, sliding, traversing, ragdoll; needs bPassMovementModeToCamera). Clear an entry to turn that offset off. Read by CameraDirector_SandboxCharacter every frame. | |
Pass Movement Mode to CamerabPassMovementModeToCamera | Boolean | true | Pass the pawn's real movement mode to the camera director (S_CharacterPropertiesForCamera.MovementMode): the director then stacks the InAir, Sliding, Traversing and Ragdoll offset rigs, and chooser rows can match on the mode. Off = constant OnGround. The CMC pawn reports OnGround, InAir, Traversing and Ragdoll; Sliding only exists on the Mover pawn. Default true. |
Runtime state (4 variables)
| Variable | Type | Default | Description |
|---|---|---|---|
Crosshair WidgetCrosshairWidget | UserWidget ref | Crosshair widget created on the local player's screen. Removed when the pawn is destroyed. | |
Parent Mesh FPParentMeshFP | SkeletalMeshComponent ref | First-person lead mesh. In first person the camera attaches to the active body's Camera Bone (default VB Camera). | |
Player ControllerPlayerController | PlayerController ref | Player controller of the owning pawn, used for crosshair and cursor aim. | |
Camera ListenersCameraListeners | Array of ActorComponent ref | Components told about perspective changes (BPI_CameraSystemListener.OnCameraViewChanged); they register themselves through BPI_CameraSystem.RegisterCameraListener. |
Functions¶
| Function | Inputs | Outputs | Description |
|---|---|---|---|
GetCrosshairAim (pure) | AimOrigin (Vector), AimDirection (Vector), AimPoint (Vector), bAimHit (Boolean), AimPlanarDirection (Vector) | Where the player aims, for the crosshair and cover targeting. Third/first person: the camera ray through the screen center. Top-down/side-scroller: the ray under the mouse cursor, or with a gamepad a point 3 m out along the stick aim. Returns the ray, the world point it hits (bAimHit) and a planar aim direction. | |
GetFixedCameraAimRotation | LookGamepad (Vector2D), LookMouse (Vector2D) | AimRotation (Rotator) | Updates and returns the aim rotation for the fixed cameras: from the gamepad stick when it moves, else from the mouse cursor. Also sets bCrosshairGamepadAim. Get Mouse Position In Viewport Get Mouse Hit Position Different Mouse Position Setups between Top Down and Side Scroller |
UpdateCrosshair | Local player only, called every tick. Shows the crosshair widget when bShowCrosshair is on and moves it to the current aim point (GetCrosshairAim), or collapses it when off. The widget decides how it looks; the camera never calls the cover system. | ||
NotifyCameraListeners | Calls OnCameraViewChanged on every registered listener with the current first-person state. | ||
CanCyclePerspective (pure) | bCanCycle (Boolean) | Perspective key gate: camera control is allowed (not during a ragdoll that locks it) and another perspective is available. | |
GetFirstAvailablePerspective (pure) | Perspective (E_CameraPerspective) | The first AllowedPerspectives entry that is available; ThirdPerson when none is. | |
GetNextAvailablePerspective (pure) | Perspective (E_CameraPerspective) | The next available perspective after the current one in AllowedPerspectives order, wrapping; the current one when there is no other. | |
OnRagdollEnded | Called when the ragdoll ends. Restores camera control and the perspective saved before the ragdoll. | ||
OnRagdollStarted | Called when the ragdoll starts. Applies the ragdoll camera control setting and optionally switches perspective. | ||
InitializeSystem | ParentPawn (Pawn ref), ParentMesh (SkeletalMeshComponent ref), ParentMesh_FP (SkeletalMeshComponent ref), GameplayCamera (GameplayCameraComponent ref) | Stores the pawn, mesh and camera references, validates the perspectives (an unavailable start perspective falls back), attaches the camera for the current perspective and caches the player controller. Needed for switching visual overrides during runtime | |
UpdatePlayerController | Keeps PlayerController current while the camera system is disabled (its Tick does nothing else then), so crosshair aim queries still have a controller. | ||
ValidatePerspectives | Called by InitializeSystem. A start CameraPerspective that is not available becomes the first available one (the perspective listeners are told). On-screen warnings: FirstPerson listed without AC_FirstPersonSystem; on pawns with a ragdoll system (BPFL_GASPALS.GetRagdollSystem: the AC_RagdollSystem component, else the pawn itself), an unavailable CameraPerspectiveDuringRagdoll. | ||
GetFirstPersonCameraBone (pure) | BoneName (Name) | First-person camera socket of the active body: the camera bone of the pawn's first-person system (its active body's setup); VB Camera without one. | |
IsPerspectiveAvailable (pure) | Perspective (E_CameraPerspective) | bAvailable (Boolean) | True when Perspective is in AllowedPerspectives and, for FirstPerson, the pawn has an enabled AC_FirstPersonSystem. Read by the perspective key, the start and ragdoll perspectives, AC_FirstPersonSystem (builds first-person meshes only when FirstPerson is available) and cover (sticky cover's switch to third person). |
GetCameraCrosshairAim | AimOrigin (Vector), AimDirection (Vector), AimPoint (Vector), bAimHit (Boolean), AimPlanarDirection (Vector) | The crosshair aim ray (GetCrosshairAim). (BPI_CameraSystem) | |
IsCameraRightShoulder | bRightShoulder (Boolean) | True when the third-person camera is on the right shoulder. (BPI_CameraSystem) | |
IsFirstPersonView | bFirstPerson (Boolean) | True when the camera is in the FirstPerson perspective and the camera system is enabled. (BPI_CameraSystem) | |
IsFirstPersonViewAllowed | bAllowed (Boolean) | True when FirstPerson is in AllowedPerspectives and the camera system is enabled (does not check the first-person system). (BPI_CameraSystem) | |
IsFixedCameraView | bFixed (Boolean) | True in the fixed-camera perspectives (TopDown, SideScroller), where aiming uses the cursor plane. (BPI_CameraSystem) | |
IsThirdPersonViewAvailable | bAvailable (Boolean) | True when the ThirdPerson perspective can be used (AllowedPerspectives). (BPI_CameraSystem) | |
OnRagdollStateChanged | bRagdolling (Boolean) | bHandled (Boolean) | Called by the ragdoll system when the ragdoll starts or ends, on the owner components that implement it and on the owner's controller when it implements it. (BPI_RagdollSystemListener) |
RegisterCameraListener | Listener (ActorComponent ref) | bHandled (Boolean) | Adds a component implementing BPI_CameraSystemListener; the camera calls its OnCameraViewChanged after every perspective change (the camera finds them through this call instead of searching for them). (BPI_CameraSystem) |
RequestFirstPersonView | bFirstPerson (Boolean) | bHandled (Boolean) | Switch to FirstPerson (true) or ThirdPerson (false). Returns false when the camera system is disabled. (BPI_CameraSystem) |
Events¶
OnCameraPerspectiveChanged(event dispatcher, NewCameraPerspective (E_CameraPerspective)): Dispatcher called when the camera perspective changes. Passes the new perspective.UpdateCameraAttachment: custom event.OnDataDrivenCVarChanged(CVarName (String)): custom event.SetCameraPerspective(NewCameraPerpective (E_CameraPerspective)): custom event.Server_SetCameraPerspective(NewCameraPerspective (E_CameraPerspective)): Server RPC, reliable.OnParentDestroyed(DestroyedActor (Actor ref)): custom event.
CameraDirector_SandboxCharacter¶
/GASPALS/Systems/CameraSystem/CameraDirector_SandboxCharacter · parent BlueprintCameraDirectorEvaluator
Settings¶
| Variable | Type | Default | Description |
|---|---|---|---|
Camera Offset RigsCameraOffsetRigs | S_CameraOffsetRigs | Fallback offset rigs, used only when the camera owner has no AC_CameraSystem. Pawns set theirs on AC_CameraSystem.CameraOffsetRigs. |
Runtime state (4 variables)
| Variable | Type | Default | Description |
|---|---|---|---|
Cover Low CamerabCoverLowCamera | Boolean | false | True while the camera should use the low-cover offset rig (character behind low cover). Set each frame from the cover system. |
Cover Edge SideCoverEdgeSide | Float | 0 | Cover camera edge side: below -0.5 means the left edge, above 0.5 the right edge, otherwise none. Picks the edge offset rig. |
Cover Shoulder SideCoverShoulderSide | Float | 0 | Cover camera shoulder side: below -0.5 puts the camera on the left, above 0.5 on the right, otherwise the player's shoulder applies. Set each frame from the cover system (0 when its bEnableCoverShoulderSwitch is off). |
Character Properties for CameraCharacterPropertiesForCamera | S_CharacterPropertiesForCamera | Per-frame snapshot of character state (perspective, stance, camera side) read from the pawn. Input for the CHT_CameraRig chooser. |
Functions¶
| Function | Inputs | Outputs | Description |
|---|---|---|---|
ActivateFirstPersonScaleRig | In first person, activates CameraRig_FP_Scale when the first-person rendering uses the Split mode (scaled arms and weapon). | ||
ActivateMovementModeRig | Third person: stacks the offset rig of the camera movement mode (InAirRig, SlidingRig, TraversingRig, RagdollRig from GetCameraOffsetRigs). The pawn passes the real mode only with AC_CameraSystem.bPassMovementModeToCamera. | ||
ActivateOffsetRig | CameraRig (CameraRigAsset ref) | Activates an offset rig on top of the main rig. Does nothing when the rig is empty, so an offset can be turned off by clearing it. | |
GetCameraOffsetRigs (pure) | OffsetRigs (S_CameraOffsetRigs) | Offset rigs to layer on the main rig: the pawn camera system CameraOffsetRigs, or this director CameraOffsetRigs when the pawn has no camera system. | |
GetCoverCameraContextOf (pure) | CoverState (ActorComponent ref) | bLowCoverCamera (Boolean), EdgeSide (Float), ShoulderSide (Float) | Cover camera state (low cover, edge side, shoulder side) from a BPI_CoverSystem component; inactive values when there is none. |
GetCoverStateProvider (pure) | ReturnValue (ActorComponent ref) | The evaluated pawn's component implementing BPI_CoverSystem, or None. |
W_Crosshair¶
/GASPALS/Systems/CameraSystem/Widgets/W_Crosshair · parent UserWidget
Settings¶
| Variable | Type | Default | Description |
|---|---|---|---|
Default ColorDefaultColor | LinearColor | (1, 1, 1, 0.95) | Colour of the crosshair dot. Default white, alpha 0.95. |
Functions¶
| Function | Inputs | Outputs | Description |
|---|---|---|---|
UpdateDotColor | Applies DefaultColor to the crosshair dot. |
BPI_CameraSystem¶
/GASPALS/Systems/CameraSystem/BPI_CameraSystem · parent Interface
What other systems ask the camera.
Functions¶
| Function | Inputs | Outputs | Description |
|---|---|---|---|
RegisterCameraListener | Listener (ActorComponent ref) | bHandled (Boolean) | Adds a component implementing BPI_CameraSystemListener; the camera calls its OnCameraViewChanged after every perspective change (the camera finds them through this call instead of searching for them). |
GetCameraCrosshairAim | AimOrigin (Vector), AimDirection (Vector), AimPoint (Vector), bAimHit (Boolean), AimPlanarDirection (Vector) | The crosshair aim ray (GetCrosshairAim). | |
IsCameraRightShoulder | bRightShoulder (Boolean) | True when the third-person camera is on the right shoulder. | |
IsFirstPersonView | bFirstPerson (Boolean) | True when the camera is in the FirstPerson perspective and the camera system is enabled. | |
IsFirstPersonViewAllowed | bAllowed (Boolean) | True when FirstPerson is in AllowedPerspectives and the camera system is enabled (does not check the first-person system). | |
IsFixedCameraView | bFixed (Boolean) | True in the fixed-camera perspectives (TopDown, SideScroller), where aiming uses the cursor plane. | |
IsThirdPersonViewAvailable | bAvailable (Boolean) | True when the ThirdPerson perspective can be used (AllowedPerspectives). | |
RequestFirstPersonView | bFirstPerson (Boolean) | bHandled (Boolean) | Switch to FirstPerson (true) or ThirdPerson (false). Returns false when the camera system is disabled. |
BPI_CameraSystemListener¶
/GASPALS/Systems/CameraSystem/BPI_CameraSystemListener · parent Interface
Implemented by components that react to perspective changes (the first-person system).
Functions¶
| Function | Inputs | Outputs | Description |
|---|---|---|---|
OnCameraViewChanged | bFirstPerson (Boolean) | bHandled (Boolean) | Called by the camera system on the owner components that implement it after the perspective changed. |