Unreal Engine Basics Chapter 6: Animation, Audio, Visual Effects Nick Prühs
Objectives • Understanding how to drive final character animation poses through animation blueprints and blend spaces • Learning how to configure, combine and play sound assets • Understanding the modular nature of particle effects in Unreal Engine
Animation Blueprints • Control the animation of a skeletal mesh • Allow you to blend animations to define the final pose for every frame • Based on a specific skeleton • Tied to character blueprints through their SkeletalMeshComponent • Variables and Event Graph just like any other blueprint
Animation Graphs • Sample, blend and manipulate poses to be applied to skeletal meshes • Provide blend nodes and state machines to evaluate the final pose
Animation State Machines • Break skeletal animations up into multiple states with transitions • Each state and each transition is another condensed graph
Animation States • Each state in turn may be a simple as just playing an animation – sometimes driven by additional parameters
Animation States • Each state in turn may be a simple as just playing an animation – sometimes driven by additional parameters
Animation State Transitions • Control how the skeletal mesh goes from state to another • Return value determines whether the animation can move through the transition, or not
Blend Spaces • Allow any number of animations to be blended between based on the values of two inputs • 2D graph where…  each input value defines one axis  animations are plotted on the graph at various points • Allows skipping parts of the interpolation through Target Weight Interpolation Speed Per Second parameter • Example:  Direction and Speed input  Forward, Left, Right and Backward movement animations
Blend Spaces
Calculate Direction for Blend Spaces • Calculates angle between character velocity and forward vector • Returns a single float, thus very useful for feeding into blend spaces
Sound Cues • Importing an audio file (preferred .wav) creates a Sound Wave asset  Provides basic overrides, such as volume, pitch or attenuation • Sound cues are composite assets that allow you to modify the behavior of audio playback, e.g.  applying random volume & pitch  selecting random waves  looping  mixing
Playing Sound As always, Kismet‘s GameplayStatics provide convenient methods for playing sound: UFUNCTION(BlueprintCallable, …) static void PlaySoundAtLocation( const UObject* WorldContextObject, USoundBase* Sound, FVector Location, FRotator Rotation, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f, float StartTime = 0.f, class USoundAttenuation* AttenuationSettings = nullptr, USoundConcurrency* ConcurrencySettings = nullptr, AActor* OwningActor = nullptr); Sound Attenuation, Sound Class and Sound Mix assets allow you further (re-usable) customization of your audio output.
Ambient Sound Just dropping a sound cue into a level will automatically create an AmbientSoundActor with various parameters.
Particle Effects • Unreal Cascade* allows for very modularly designed particle systems:  EmitterActors exist in your level, controlling where and how the particle systems are used in your scene  ParticleSystem assets contain multiple emitters  Emitters emit a specific type of particle for an effect  Modules define particle behavior * soon to be replaced by Niagara
Particle Effects Example – Starter Content Explosion Example for a system combining multiple emitters with consisting of multiple modules each:
Spawning Emitters As always, Kismet‘s GameplayStatics provide convenient methods for spawning emitters: UFUNCTION(BlueprintCallable, …) static UParticleSystemComponent* SpawnEmitterAtLocation( const UObject* WorldContextObject, UParticleSystem* EmitterTemplate, FVector Location, FRotator Rotation = FRotator::ZeroRotator, FVector Scale = FVector(1.f), bool bAutoDestroy = true, EPSCPoolMethod PoolingMethod = EPSCPoolMethod::None);
Spawning Emitters As always, Kismet‘s GameplayStatics provide convenient methods for spawning emitters: UFUNCTION(BlueprintCallable, …) static UParticleSystemComponent* SpawnEmitterAttached( class UParticleSystem* EmitterTemplate, class USceneComponent* AttachToComponent, FName AttachPointName = NAME_None, FVector Location = FVector(ForceInit), FRotator Rotation = FRotator::ZeroRotator, FVector Scale = FVector(1.f), EAttachLocation::Type LocationType = EAttachLocation::KeepRelativeOffset, bool bAutoDestroy = true, EPSCPoolMethod PoolingMethod = EPSCPoolMethod::None);
Assignment #6 – Animation, Audio, Visual Effects 1. Create a blend space for run animations of your character. 2. Create an animation blueprint calculating direction and speed. 3. Create the animation state machine for run and jump animations. 4. Play a sound when firing a projectile. 5. Show a particle effect when a projectile hits a target. Bonus: Play death, fire and hit react animations.
References • Epic Games. Setting Up Character Movement in Blueprints. https://docs.unrealengine.com/en- US/Gameplay/HowTo/CharacterMovement/Blueprints/index.html, February 2020. • Epic Games. Animation Blueprints. https://docs.unrealengine.com/en- US/Engine/Animation/AnimBlueprints/index.html, February 2020. • Epic Games. AnimGraph. https://docs.unrealengine.com/en- US/Engine/Animation/AnimBlueprints/AnimGraph/index.html, February 2020. • Epic Games. Overview of State Machines. https://docs.unrealengine.com/en- US/Engine/Animation/StateMachines/Overview/index.html, February 2020. • Epic Games. Blend Spaces Overview. https://docs.unrealengine.com/en- US/Engine/Animation/Blendspaces/Overview/index.html, February 2020. • Epic Games. Audio System Overview. https://docs.unrealengine.com/en- US/Engine/Audio/Overview/index.html, February 2020. • Epic Games. Key Particle Concepts. https://docs.unrealengine.com/en- US/Engine/Rendering/ParticleSystems/Overview/index.html, February 2020.
And now … Make something Unreal!
See you next time! https://www.slideshare.net/npruehs https://github.com/npruehs/teaching- unreal-engine/releases/tag/assignment06 npruehs@outlook.com

Unreal Engine Basics 06 - Animation, Audio, Visual Effects

  • 1.
    Unreal Engine Basics Chapter6: Animation, Audio, Visual Effects Nick Prühs
  • 2.
    Objectives • Understanding howto drive final character animation poses through animation blueprints and blend spaces • Learning how to configure, combine and play sound assets • Understanding the modular nature of particle effects in Unreal Engine
  • 3.
    Animation Blueprints • Controlthe animation of a skeletal mesh • Allow you to blend animations to define the final pose for every frame • Based on a specific skeleton • Tied to character blueprints through their SkeletalMeshComponent • Variables and Event Graph just like any other blueprint
  • 4.
    Animation Graphs • Sample,blend and manipulate poses to be applied to skeletal meshes • Provide blend nodes and state machines to evaluate the final pose
  • 5.
    Animation State Machines •Break skeletal animations up into multiple states with transitions • Each state and each transition is another condensed graph
  • 6.
    Animation States • Eachstate in turn may be a simple as just playing an animation – sometimes driven by additional parameters
  • 7.
    Animation States • Eachstate in turn may be a simple as just playing an animation – sometimes driven by additional parameters
  • 8.
    Animation State Transitions •Control how the skeletal mesh goes from state to another • Return value determines whether the animation can move through the transition, or not
  • 9.
    Blend Spaces • Allowany number of animations to be blended between based on the values of two inputs • 2D graph where…  each input value defines one axis  animations are plotted on the graph at various points • Allows skipping parts of the interpolation through Target Weight Interpolation Speed Per Second parameter • Example:  Direction and Speed input  Forward, Left, Right and Backward movement animations
  • 10.
  • 11.
    Calculate Direction forBlend Spaces • Calculates angle between character velocity and forward vector • Returns a single float, thus very useful for feeding into blend spaces
  • 12.
    Sound Cues • Importingan audio file (preferred .wav) creates a Sound Wave asset  Provides basic overrides, such as volume, pitch or attenuation • Sound cues are composite assets that allow you to modify the behavior of audio playback, e.g.  applying random volume & pitch  selecting random waves  looping  mixing
  • 13.
    Playing Sound As always,Kismet‘s GameplayStatics provide convenient methods for playing sound: UFUNCTION(BlueprintCallable, …) static void PlaySoundAtLocation( const UObject* WorldContextObject, USoundBase* Sound, FVector Location, FRotator Rotation, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f, float StartTime = 0.f, class USoundAttenuation* AttenuationSettings = nullptr, USoundConcurrency* ConcurrencySettings = nullptr, AActor* OwningActor = nullptr); Sound Attenuation, Sound Class and Sound Mix assets allow you further (re-usable) customization of your audio output.
  • 14.
    Ambient Sound Just droppinga sound cue into a level will automatically create an AmbientSoundActor with various parameters.
  • 15.
    Particle Effects • UnrealCascade* allows for very modularly designed particle systems:  EmitterActors exist in your level, controlling where and how the particle systems are used in your scene  ParticleSystem assets contain multiple emitters  Emitters emit a specific type of particle for an effect  Modules define particle behavior * soon to be replaced by Niagara
  • 16.
    Particle Effects Example– Starter Content Explosion Example for a system combining multiple emitters with consisting of multiple modules each:
  • 17.
    Spawning Emitters As always,Kismet‘s GameplayStatics provide convenient methods for spawning emitters: UFUNCTION(BlueprintCallable, …) static UParticleSystemComponent* SpawnEmitterAtLocation( const UObject* WorldContextObject, UParticleSystem* EmitterTemplate, FVector Location, FRotator Rotation = FRotator::ZeroRotator, FVector Scale = FVector(1.f), bool bAutoDestroy = true, EPSCPoolMethod PoolingMethod = EPSCPoolMethod::None);
  • 18.
    Spawning Emitters As always,Kismet‘s GameplayStatics provide convenient methods for spawning emitters: UFUNCTION(BlueprintCallable, …) static UParticleSystemComponent* SpawnEmitterAttached( class UParticleSystem* EmitterTemplate, class USceneComponent* AttachToComponent, FName AttachPointName = NAME_None, FVector Location = FVector(ForceInit), FRotator Rotation = FRotator::ZeroRotator, FVector Scale = FVector(1.f), EAttachLocation::Type LocationType = EAttachLocation::KeepRelativeOffset, bool bAutoDestroy = true, EPSCPoolMethod PoolingMethod = EPSCPoolMethod::None);
  • 19.
    Assignment #6 –Animation, Audio, Visual Effects 1. Create a blend space for run animations of your character. 2. Create an animation blueprint calculating direction and speed. 3. Create the animation state machine for run and jump animations. 4. Play a sound when firing a projectile. 5. Show a particle effect when a projectile hits a target. Bonus: Play death, fire and hit react animations.
  • 20.
    References • Epic Games.Setting Up Character Movement in Blueprints. https://docs.unrealengine.com/en- US/Gameplay/HowTo/CharacterMovement/Blueprints/index.html, February 2020. • Epic Games. Animation Blueprints. https://docs.unrealengine.com/en- US/Engine/Animation/AnimBlueprints/index.html, February 2020. • Epic Games. AnimGraph. https://docs.unrealengine.com/en- US/Engine/Animation/AnimBlueprints/AnimGraph/index.html, February 2020. • Epic Games. Overview of State Machines. https://docs.unrealengine.com/en- US/Engine/Animation/StateMachines/Overview/index.html, February 2020. • Epic Games. Blend Spaces Overview. https://docs.unrealengine.com/en- US/Engine/Animation/Blendspaces/Overview/index.html, February 2020. • Epic Games. Audio System Overview. https://docs.unrealengine.com/en- US/Engine/Audio/Overview/index.html, February 2020. • Epic Games. Key Particle Concepts. https://docs.unrealengine.com/en- US/Engine/Rendering/ParticleSystems/Overview/index.html, February 2020.
  • 21.
    And now … Makesomething Unreal!
  • 22.
    See you nexttime! https://www.slideshare.net/npruehs https://github.com/npruehs/teaching- unreal-engine/releases/tag/assignment06 npruehs@outlook.com