ue-character-movement
Use when writing or debugging UCharacterMovementComponent code: custom movement modes, floor detection, jumping, crouching, root motion, moving platforms, or client-side movement prediction. Also use when the user mentions 'CharacterMovementComponent', 'CMC', 'PhysCustom', 'PhysWalking', 'MOVE_Custom', 'FSavedMove_Character', 'GetCompressedFlags', 'FCharacterNetworkMoveData', 'MovementBase', 'LaunchCharacter', 'WalkableFloorAngle', 'SetGravityDirection', 'NavWalking', or 'FRootMotionSource'. For the Mover plugin, see ue-mover; for replication mechanics, see ue-networking-replication.
quodsoler · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add quodsoler/unreal-engine-skills --skill ue-character-movement技能说明
name: ue-character-movement description: "Use when writing or debugging UCharacterMovementComponent code: custom movement modes, floor detection, jumping, crouching, root motion, moving platforms, or client-side movement prediction. Also use when the user mentions 'CharacterMovementComponent', 'CMC', 'PhysCustom', 'PhysWalking', 'MOVE_Custom', 'FSavedMove_Character', 'GetCompressedFlags', 'FCharacterNetworkMoveData', 'MovementBase', 'LaunchCharacter', 'WalkableFloorAngle', 'SetGravityDirection', 'NavWalking', or 'FRootMotionSource'. For the Mover plugin, see ue-mover; for replication mechanics, see ue-networking-replication." metadata: version: "2.0.0" engine: "5.8"
UE Character Movement
Target engine: UE 5.8. APIs below are verified against the 5.8 headers; older forms are listed under "Deprecated — do not use".
This skill covers UCharacterMovementComponent (CMC) and ACharacter: the movement-mode pipeline, floor detection and step-up, custom movement modes, client-side prediction and correction, root motion, custom gravity, and the 5.8 movement-base rework. Everything here ships in the Engine module — no plugin and no extra Build.cs entry beyond "Engine". Public headers: GameFramework/CharacterMovementComponent.h (which already pulls in GameFramework/RootMotionSource.h, GameFramework/CharacterMovementReplication.h, CharacterMovementComponentAsync.h and Interfaces/MovementBaseInterface.h), GameFramework/Character.h.
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 CMC and the Mover plugin | CMC vs Mover |
| Class hierarchy, movement modes, mode transitions | CMC Architecture |
| Standing on a lift, rotating platform, vehicle, physics body | Movement Base |
Where a tick goes, PhysWalking/PhysFalling, sweeps, sliding | Movement Pipeline |
| Falling through floors, step-up, walkable angle, perching | Floor Detection |
| Wall-run, climb, dash, grapple, any new movement type | Custom Movement Modes |
| Multiplayer desync, rubber-banding, saved moves, compressed flags | Network Prediction |
| Knockback, dashes, animation-driven motion | Root Motion |
| Walking on walls/ceilings, planet gravity | Custom Gravity |
| AI agents, navmesh-driven walking, RVO avoidance | NavMesh Walking |
| Jump/crouch/launch from gameplay code | ACharacter API |
| Speeds, friction, braking, rotation flags | Key Properties |
Deep templates live in cmc-extension-patterns.md; per-mode internals and flow diagrams live in movement-pipeline.md.
CMC vs Mover
Mover (Experimental in 5.8) is a separate plugin (Mover, not enabled by default) built around UMoverComponent, UBaseMovementMode, FLayeredMoveBase and UCharacterMoverComponent. It is not a drop-in CMC replacement.
| Situation | Use |
|---|---|
| Shipping title, any engine-supported platform | CMC |
Existing ACharacter hierarchy, animation and AI already wired to CMC | CMC |
| Networked gameplay that must be stable today | CMC |
| Non-capsule, non-humanoid movers (vehicles, drones) that still want rollback networking | Mover |
Movement composed from data-driven modes/modifiers instead of a Phys* subclass | Mover |
| Movement simulated on the physics thread with Chaos | Mover (ChaosMover) |
| Prototype that can absorb Experimental API churn | Mover |
Mover details belong to ue-mover. Do not mix the two components on one pawn.
CMC Architecture
UActorComponent -> UMovementComponent -> UNavMovementComponent -> UPawnMovementComponent -> UCharacterMovementComponent
UNavMovementComponent also implements INavMovementInterface; UCharacterMovementComponent additionally implements IRVOAvoidanceInterface and INetworkPredictionInterface, and is declared UCLASS(MinimalAPI).
CMC is a default subobject on ACharacter (ACharacter::CharacterMovementComponentName). ACharacter owns the capsule, mesh and high-level verbs (Jump, Crouch, LaunchCharacter); CMC owns simulation, floor detection and prediction.
Movement Modes
EMovementMode (Engine/EngineTypes.h):
| Mode | Meaning |
|---|---|
MOVE_None | No movement processing |
MOVE_Walking | Ground movement with floor detection and step-up |
MOVE_NavWalking | Walking driven by navmesh projection |
MOVE_Falling | Airborne: gravity, air control, landing |
MOVE_Swimming | Fluid movement with buoyancy |
MOVE_Flying | Free 3D movement, no gravity |
MOVE_Custom | User-defined; dispatches to PhysCustom with a uint8 sub-mode |
// UCharacterMovementComponent. SetMovementMode is BlueprintCallable;
// OnMovementModeChanged is protected and not a UFUNCTION (override it in C++)
virtual void SetMovementMode(EMovementMode NewMovementMode, uint8 NewCustomMode = 0);
virtual void OnMovementModeChanged(EMovementMode PreviousMovementMode, uint8 PreviousCustomMode);
ACharacter::OnMovementModeChanged(EMovementMode PrevMovementMode, uint8 PreviousCustomMode = 0) fires after the CMC hook and broadcasts MovementModeChangedDelegate (FMovementModeChangedSignature). Put enter/exit logic for custom modes in the CMC override; the current sub-mode is the uint8 CustomMovementMode member.
Movement Base
The movement base is the object a character stands on and moves with. In 5.8 it is no longer a UPrimitiveComponent*: it is FMovementBaseInterfaceData (Interfaces/MovementBaseInterface.h), which