Communitygithub.com

UE Animationssystem

Du bist ein Experte für Unreal Engines Animationssystem.

Was ist UE Animationssystem?

Diese Skill-Anleitung beschreibt umfassend die Arbeit mit Unreal Engines Animationssystem, speziell für Entwickler von Spielmechaniken, KI und Cinematics. Sie behandelt die Architektur der AnimInstance mit ihren Native-Funktionen, die korrekte Nutzung von Anim Montages (inklusive Multiplayer-Replikation und GAS-Integration), State Machines, Blend Spaces und Animation Notifies. Zusätzlich werden erweiterte Themen wie Foot-IK, Linked Anim Layers und das FAnimInstanceProxy für thread-sicheren Zugriff auf Animationsdaten erklärt. Die Anleitung ist praxisnah mit vielen C++-Codebeispielen und eignet sich für Entwickler, die in C++ oder Blueprint arbeiten und sowohl Singleplayer- als auch Multiplayer-Projekte umsetzen.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/quodsoler/unreal-engine-skills/ue-animation-system

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht UE Animationssystem?

Du bist ein Experte für Unreal Engines Animationssystem.

Kontextprüfung

Lies zuerst .agents/ue-project-context.md. Notiere, welche Plugins aktiviert sind (Control Rig, Motion Matching, Full Body IK), ob GAS verwendet wird und die Skeleton-/Charakterhierarchie.

Informationen sammeln

  1. Welcher Animationsbedarf? (Locomotion, Ability, Cinematic, IK, procedural)
  2. Nur C++, nur Blueprint oder gemischt?
  3. Verwendet der Charakter ACharacter mit einer bestehenden USkeletalMeshComponent?
  4. Ist GAS aktiv? (beeinflusst Montage-Replikation)
  5. Multiplayer? (bestimmt Replikationsstrategie)
  6. Verwendet das Projekt modulare Linked Anim Layers?

Architektur

ACharacter / AActor
  └── USkeletalMeshComponent
        └── UAnimInstance subclass
              ├── NativeInitializeAnimation()           [Setup, Game Thread]
              ├── NativeUpdateAnimation(float dt)       [Game Thread]
              ├── NativeThreadSafeUpdateAnimation(dt)   [Worker Thread]
              ├── FAnimInstanceProxy                    [Worker Thread Auswertung]
              └── Montage API / Linked Layers

Animationsupdates laufen in zwei Phasen. Game Thread: NativeUpdateAnimation – sicher zum Lesen des Gameplay-Zustands. Worker Thread: Blend Tree Auswertung. Schreibe alle gemeinsam genutzten Zustände als UPROPERTY() Transient-Member in NativeUpdateAnimation; lese diese zwischengespeicherten Werte in NativeThreadSafeUpdateAnimation.


AnimInstance

Subclass Pattern

// MyAnimInstance.h
UCLASS()
class MYGAME_API UMyAnimInstance : public UAnimInstance
{
    GENERATED_BODY()

    virtual void NativeInitializeAnimation() override;
    virtual void NativeUpdateAnimation(float DeltaSeconds) override;
    virtual void NativeThreadSafeUpdateAnimation(float DeltaSeconds) override;

protected:
    UPROPERTY(Transient) TObjectPtr<ACharacter> OwningCharacter;
    UPROPERTY(Transient) TObjectPtr<UCharacterMovementComponent> MovementComp;

    UPROPERTY(Transient, BlueprintReadOnly, Category="Locomotion")
    float Speed = 0.f;

    UPROPERTY(Transient, BlueprintReadOnly, Category="Locomotion")
    float Direction = 0.f;

    UPROPERTY(Transient, BlueprintReadOnly, Category="Locomotion")
    bool bIsInAir = false;
};
// MyAnimInstance.cpp
void UMyAnimInstance::NativeInitializeAnimation()
{
    Super::NativeInitializeAnimation(); // IMMER super aufrufen
    OwningCharacter = Cast<ACharacter>(TryGetPawnOwner());
    if (OwningCharacter)
        MovementComp = OwningCharacter->GetCharacterMovement();
}

void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
    Super::NativeUpdateAnimation(DeltaSeconds);
    if (!OwningCharacter || !MovementComp) return;

    const FVector Velocity = MovementComp->Velocity;
    Speed    = Velocity.Size2D();
    bIsInAir = MovementComp->IsFalling();

    if (Speed > 3.f)
    {
        const FRotator ActorRot    = OwningCharacter->GetActorRotation();
        const FRotator VelocityRot = Velocity.ToOrientationRotator();
        Direction = UKismetMathLibrary::NormalizedDeltaRotator(
            VelocityRot, ActorRot).Yaw;
    }
}

void UMyAnimInstance::NativeThreadSafeUpdateAnimation(float DeltaSeconds)
{
    Super::NativeThreadSafeUpdateAnimation(DeltaSeconds);
    // Nur UPROPERTY-Member lesen, die oben in NativeUpdateAnimation geschrieben wurden.
    // Keine UObject-Funktionen aufrufen, die nicht als BlueprintThreadSafe markiert sind.
}

FAnimInstanceProxy – Thread-Sicherer Zugriff

Schwere Animationslogik kann auf Worker-Threads über NativeThreadSafeUpdateAnimation laufen. Zugriff auf gemeinsame Daten über den Proxy:

void UMyAnimInstance::NativeThreadSafeUpdateAnimation(float DeltaSeconds)
{
    FMyAnimInstanceProxy& Proxy = GetProxyOnAnyThread<FMyAnimInstanceProxy>();
    Proxy.Speed = Proxy.Velocity.Size();
    Proxy.bIsFalling = Proxy.MovementMode == EMovementMode::MOVE_Falling;
}
// FMyAnimInstanceProxy Deklaration – Worker-Thread Datencontainer
USTRUCT()
struct FMyAnimInstanceProxy : public FAnimInstanceProxy
{
    GENERATED_BODY()
    FMyAnimInstanceProxy() = default;
    explicit FMyAnimInstanceProxy(UAnimInstance* Instance) : FAnimInstanceProxy(Instance) {}

    float Speed = 0.f;
    FVector Velocity = FVector::ZeroVector;
    TEnumAsByte<EMovementMode> MovementMode = MOVE_None;

    virtual void PreUpdate(UAnimInstance* AnimInstance, float DeltaSeconds) override;
    virtual void Update(float DeltaSeconds) override;
};

// In UMyAnimInstance: CreateAnimInstanceProxy überschreiben, um deinen Proxy zurückzugeben
virtual FAnimInstanceProxy* CreateAnimInstanceProxy() override
{ return new FMyAnimInstanceProxy(this); }

Die Engine kopiert Daten zwischen Game Thread und Worker Thread an sicheren Synchronisationspunkten.


Montagen

Quelle: AnimMontage.h, AnimInstance.h

Wichtige API (UAnimInstance):

float Montage_Play(UAnimMontage*, float PlayRate=1.f,
    EMontagePlayReturnType=MontageLength, float StartAt=0.f, bool bStopAll=true);
void  Montage_Stop(float BlendOut, const UAnimMontage* Montage=nullptr);
void  Montage_Pause(const UAnimMontage* Montage=nullptr);
void  Montage_Resume(const UAnimMontage* Montage);
void  Montage_JumpToSection(FName Section, const UAnimMontage* Montage=nullptr);
void  Montage_SetNextSection(FName From, FName To, const UAnimMontage* Montage=nullptr);
bool  Montage_IsActive(const UAnimMontage*) const;
bool  Montage_IsPlaying(const UAnimMontage*) const;
FName Montage_GetCurrentSection(const UAnimMontage* Montage=nullptr) const;
float Montage_GetPosition(const UAnimMontage*) const;

Spielen + Delegate Pattern

void UMyComponent::PlayAttackMontage(UAnimMontage* Montage)
{
    UAnimInstance* AnimInst = GetMesh()->GetAnimInstance();
    if (!AnimInst || !Montage) return;

    // Zuerst spielen – Montage_SetEndDelegate ruft GetActiveInstanceForMontage()
    // intern auf, was nullptr zurückgibt, bis Montage_Play die Instanz erstellt.
    if (AnimInst->Montage_Play(Montage) <= 0.f) return;

    FOnMontageEnded EndDelegate;
    EndDelegate.BindUObject(this, &UMyComponent::OnAttackEnded);
    AnimInst->Montage_SetEndDelegate(EndDelegate, Montage);

    FOnMontageBlendingOutStarted BlendOutDelegate;
    BlendOutDelegate.BindUObject(this, &UMyComponent::OnAttackBlendingOut);
    AnimInst->Montage_SetBlendingOutDelegate(BlendOutDelegate, Montage);
}

void UMyComponent::OnAttackEnded(UAnimMontage* Montage, bool bInterrupted) { }
void UMyComponent::OnAttackBlendingOut(UAnimMontage* Montage, bool bInterrupted) { }

Dynamic Slot Montage

UAnimMontage* DynMontage = AnimInst->PlaySlotAnimationAsDynamicMontage(
    SomeSequence, FName("UpperBody"), 0.25f, 0.25f, 1.f, 1);

Multiplayer-Replikation

  • Mit GAS: UAbilitySystemComponent::PlayMontage() verwenden – GAS übernimmt die Replikation über FGameplayAbilityRepAnimMontage.
  • Ohne GAS: Einen Montage-Pointer oder eine benutzerdefinierte Rep-Struct replizieren; der Server ruft Montage_Play auf, Clients spielen bei OnRep_.
  • Rufe Montage_Play niemals unabhängig auf allen Netzrollen ohne Synchronisation auf.

GAS-Integration – PlayMontageAndWait

// GAS-Ability-Task – PlayMontageAndWait (erfordert GameplayAbilities-Modul)
UAbilityTask_PlayMontageAndWait* Task =
    UAbilityTask_PlayMontageAndWait::CreatePlayMontageAndWaitProxy(
        this, NAME_None, AttackMontage, 1.f);
Task->OnCompleted.AddDynamic(this, &UMyAbility::OnMontageCompleted);
Task->OnInterrupted.AddDynamic(this, &UMyAbility::OnMontageInterrupted);
Task->ReadyForActivation();  // muss aufgerufen werden, um den Task zu starten

Blend Spaces

Blend Spaces sind Daten-Assets, die im AnimGraph abgetastet werden. Steuere sie, indem du UPROPERTY-Member auf der AnimInstance setzt, die der AnimGraph liest.

  • 1D (UBlendSpace1D): einzelne Achse, typischerweise Geschwindigkeit (0–600). Verwende FInterpolationParameter mit InterpolationType=SpringDamper, InterpolationTime=0.15, DampingRatio=1.0.
  • 2D (UBlendSpace): zwei Achsen – Richtung (-180 bis 180) und Geschwindigkeit (0–600). Kardinalrichtungs-Samples auf jeder Geschwindigkeitsstufe.
  • Aim Offset (UAimOffsetBlendSpace): additiver Blend Space für Yaw/Pitch-Zielen, platziert nach der Basis-Locomotion-Pose im AnimGraph.

Siehe references/locomotion-setup.md für die vollständige Achsenkonfiguration und Beispielplatzierung.


State Machines

State Machines leben im AnimGraph. Binde native C++-Logik an Übergangsregeln und Zustandseintritt/-austritt ohne Blueprint:

// In NativeInitializeAnimation()
AddNativeTransitionBinding(
    FName("LocomotionSM"), FName("Idle"), FName("Walk/Run"),
    FCanTakeTransition::CreateUObject(this, &UMyAnimInstance::CanStartMoving),
    FName("IdleToMoving"));

AddNativeStateEntryBinding(
    FName("LocomotionSM"), FName("Land"),
    FOnGraphStateChanged::CreateUObject(this, &UMyAnimInstance::OnLandEntered));

Frage den Zustandsautomaten zur Laufzeit ab:

const FAnimNode_StateMachine* SM =
    GetStateMachineInstanceFromName(FName("LocomotionSM"));
float RunWeight = GetInstanceStateWeight(
    GetStateMachineIndex(FName("LocomotionSM")), SM->GetCurrentState());

Conduit-Knoten

Conduits werten eine einzelne Boolean-Regel aus und verzweigen zu mehreren Zielzuständen – sie ersetzen duplizierte Übergangslogik. Füge einen Conduit im AnimGraph-Editor hinzu; sein CanEnterTransition wird einmal ausgeführt und alle ausgehenden Übergänge teilen sich das Ergebnis. Verwende Conduits, wenn drei oder mehr Zustände dieselbe Eintrittsbedingung benötigen (z. B. „ist am Boden?

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

Verwandte Skills