# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/using-the-npc-spawner-with-animations-in-unreal-editor-for-fortnite
# Local doc: epic-docs/documentation/en-us/uefn/using-the-npc-spawner-with-animations-in-unreal-editor-for-fortnite.md
# Section: Play Animation Example
using { /Fortnite.com/AI }
using { /Fortnite.com/Animation/PlayAnimation }
using { /Verse.org/Simulation }
using { /Fortnite.com/Characters }
basic_play_anim_example := class(npc_behavior):
# The speed to play the animation at.
@editable
PlayRate : float = 1.0
# How long to blend the previous animation into
# the current one.
@editable
BlendInTime : float = 0.25
# How long to blend the current animation into
# the next one.
@editable
BlendOutTime : float = 0.25
# The position in seconds to start playing the
# animation from.
@editable
StartPositionSeconds : float = 0.0
# How long to wait before restarting the animation.
@editable
SleepDuration : float = 2.0
OnBegin<override>()<suspends>:void=
if:
# Get the animation controller of the NPC Character
Agent := GetAgent[]
Verse Library
verse
03 Play Animation Example
Defines an NPC behavior class that plays, waits, and repeats animations on start.
extracted-snippets/documentation/en-us/uefn/using-the-npc-spawner-with-animations-in-unreal-editor-for-fortnite/03-play-animation-example.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.