ue-gameplay-cameras
Use when building or fixing Unreal Engine cameras — spring-arm third-person rigs, first-person cameras, view-target blends, camera shakes, camera modifiers, cine cameras, or the Gameplay Camera System plugin. Also use when the user mentions 'APlayerCameraManager', 'USpringArmComponent', 'TargetArmLength', 'bUsePawnControlRotation', 'SetViewTargetWithBlend', 'UpdateViewTarget', 'CalcCamera', 'UCameraModifier', 'camera shake', 'UCameraShakeBase', 'FMinimalViewInfo', 'UGameplayCameraComponent', 'camera rig', 'camera director' or 'ShowDebug Camera'. For Sequencer shots, see ue-sequencer-cinematics; for the classes that own the camera, see ue-gameplay-framework; for input, see ue-input-system.
quodsoler · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add quodsoler/unreal-engine-skills --skill ue-gameplay-cameras技能说明
name: ue-gameplay-cameras description: "Use when building or fixing Unreal Engine cameras — spring-arm third-person rigs, first-person cameras, view-target blends, camera shakes, camera modifiers, cine cameras, or the Gameplay Camera System plugin. Also use when the user mentions 'APlayerCameraManager', 'USpringArmComponent', 'TargetArmLength', 'bUsePawnControlRotation', 'SetViewTargetWithBlend', 'UpdateViewTarget', 'CalcCamera', 'UCameraModifier', 'camera shake', 'UCameraShakeBase', 'FMinimalViewInfo', 'UGameplayCameraComponent', 'camera rig', 'camera director' or 'ShowDebug Camera'. For Sequencer shots, see ue-sequencer-cinematics; for the classes that own the camera, see ue-gameplay-framework; for input, see ue-input-system." metadata: version: "2.0.0" engine: "5.8"
UE Gameplay Cameras
Target engine: UE 5.8. APIs below are verified against the 5.8 headers; older forms are listed under "Deprecated — do not use".
Two camera stacks ship in 5.8. The classic stack lives in the Engine module (Classes/Camera, Classes/GameFramework/SpringArmComponent.h) with shake patterns in the EngineCameras plugin and film-style cameras in CinematicCamera; the data-driven Gameplay Camera System lives in the GameplayCameras plugin (Experimental in 5.8, but enabled by default). Build.cs needs "Core", "CoreUObject", "Engine", plus "CinematicCamera" for cine cameras, "EngineCameras" for shake patterns, and "GameplayCameras" for the plugin.
Context
Read .agents/ue-project-context.md if it exists (module names, conventions, enabled plugins, GAS/networking setup). Do not stop if it is missing.
Identify the area from the request and the codebase. Ask only when two plausible readings would produce different code.
| Request is about… | Go to |
|---|---|
| Choosing between the two stacks | Classic Stack or Gameplay Camera System |
| Who computes the final view each frame | How the Classic Pipeline Runs |
| Third-person boom, camera lag, collision probe | Third-Person Spring Arm Camera |
| First-person camera, eye height, view rotation | First-Person Camera |
| Switching cameras, blending between actors | View Targets and Blending |
| Pitch clamps, FOV, fades, custom camera logic | Custom APlayerCameraManager |
| Persistent post-effects on the camera (lean, recoil, lock-on) | Camera Modifiers |
| Explosions, hits, world-space rumble | Camera Shakes |
| Focal length, aperture, focus, rails and cranes | Cinematic Cameras |
| Camera assets, rigs, directors, blends, control rotation | Gameplay Camera System |
| Writing a new camera node and evaluator | Custom Camera Node in C++ |
| Nothing renders, wrong camera, jitter | Debugging Cameras |
Full classic API surface (post-process on cameras, FMinimalViewInfo fields, shake pattern catalogue, cine camera settings): references/classic-camera-stack.md. Node/director/service catalogue, camera variables, evaluation contexts and CVars: references/gameplay-camera-system.md.
Classic Stack or Gameplay Camera System
| Need | Classic stack | Gameplay Camera System |
|---|---|---|
| Ship-today stability | Yes — production API | Plugin is Experimental in 5.8 (IsExperimentalVersion in GameplayCameras.uplugin), API still moving |
| Enabled out of the box | Always (Engine module) | Yes — "EnabledByDefault": true |
| One camera per pawn, small number of modes | Best fit | Overkill |
| Many camera modes with authored blends and transitions | Hand-rolled state machine in UpdateViewTarget | Built in: camera rigs + transitions + blend stack |
| Designers author cameras without C++ | Blueprint subclasses only | Camera assets, rig graphs, State Tree directors |
| Per-mode post-process, framing, collision push | Write it yourself | Shipped camera nodes |
| Camera shakes | UCameraShakeBase + patterns | UCameraShakeAsset + shake camera nodes |
Mixing is supported: AGameplayCamerasPlayerCameraManager is an APlayerCameraManager subclass, so classic view targets, fades and modifiers still work while the plugin runs the evaluation.
How the Classic Pipeline Runs
APlayerControllerholdsPlayerCameraManager(spawned byvirtual void SpawnPlayerCameraManager()fromTSubclassOf<APlayerCameraManager> PlayerCameraManagerClass).APlayerCameraManager::UpdateCamera(float DeltaTime)→DoUpdateCamera(float DeltaTime)→UpdateViewTarget(FTViewTarget& OutVT, float DeltaTime).UpdateViewTargetfillsOutVT.POV(anFMinimalViewInfo). AnACameraActortarget uses its camera component directly; any other target getsTarget->CalcCamera(PlayerCameraManager.cpp:354), whose baseAActorimplementation uses the first active camera component whenbFindCameraComponentWhenViewTargetis true, else the actor's eyes viewpoint (Actor.cpp:3688-3706).ApplyCameraModifiers(float DeltaTime, FMinimalViewInfo& InOutPOV)runs everyUCameraModifierinModifierListbyPriority(0 = highest).- The result is cached;
GetCameraLocation(),GetCameraRotation()andGetCameraCacheView()read it, andAPlayerController::GetPlayerViewPoint(FVector& out_Location, FRotator& out_Rotation)returns it.
bAutoManageActiveCameraTarget on APlayerController (default true) makes possession call virtual void AutoManageActiveCameraTarget(AActor* SuggestedTarget), which is why a freshly possessed pawn becomes the view target with no code.
Third-Person Spring Arm Camera
// MyCharacter.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyCharacter.generated.h"
clas
阅读完整来源 ↗