Knowledge base
Knowledge base
Knowledge base
Free, anonymous browsing of Unreal Engine Blueprint examples, node references, and best practices. The same content the WoalzCraft plugin uses to generate Blueprints.
22 results for State Machine
A graph of animation states connected by transitions. Each state plays a sequence/blend; transitions fire on rule conditions.
Variables: CurrentState (your EState enum: Idle, Patrol, Chase, Attack, Dead). EventTick or custom Update event → Switch on EState(CurrentState) → Idle: [idle logic] → Patrol: [patrol logic] → Chase: [chase logic] etc. State transitions via custom events: OnEnemySpotted → SetVariable(CurrentState=EState::Chase). OnEnemyLost → SetVariable(CurrentState=EState::Patrol). OnDamaged → Branch(Health<=0) → True: SetVariable(CurrentState=EState::Dead). Key: Switch On Enum node — connect enum variable to the input, each value gets an exec output pin.
An AnimBP — drives Skeletal Mesh animation via a state machine + transition rules. Set AnimClass on the Skeletal Mesh Component.
GateUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoSETUP: Create Blueprint inheriting UGameInstanceSubsystem (or UWorldSubsystem for level-scoped). Override Initialize(Collection) to set up. Override Deinitialize to clean up. Add game variables here (Score, PlayTime, Settings). ACCESS FROM ANYWHERE: GetGameInstance → GetSubsystem(BP_GameSubsystem) → CastTo<BP_GameSubsystem> → access variables. WHY: Subsystems auto-create, auto-destroy, and don't need FindActor. Better than GameInstance for well-organized systems. UGameInstanceSubsystem persists across levels. UWorldSubsystem is recreated each level.
K2Node_EnhancedInputAction. ActionValue type depends on InputAction (Bool, Float, Axis2D, Axis3D). Triggers: Started, Ongoing, Triggered, Completed, Canceled.
EnhancedInputActionUE 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoGet Game StateUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoPossessPawnUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoSetup: Create InputAction assets (IA_Move Axis2D, IA_Jump Digital). Create InputMappingContext (IMC_Default) mapping keys to IAs. BeginPlay: GetPlayerController → GetEnhancedInputLocalPlayerSubsystem → AddMappingContext(IMC_Default, 0). Bind: EnhancedInputAction IA_Move → Triggered pin → ActionValue → BreakVector2D → AddMovementInput.
Dealing damage: Event → ApplyDamage(TargetActor, BaseDamage, InstigatorController, DamageCauser, DamageTypeClass). Receiving: EventAnyDamage → Damage output → Subtract_FloatFloat(CurrentHealth, Damage) → FClamp(Result, 0, MaxHealth) → SET CurrentHealth → Branch(CurrentHealth <= 0) → True: DestroyActor. Initialize CurrentHealth=MaxHealth in BeginPlay.