Verse Library verse

01 Task

Spawns independent tasks and awaits completion while continuing execution concurrently.

extracted-snippets/documentation/en-us/uefn/task-in-verse/01-task.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/task-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/task-in-verse.md
# Section:    Task
spawn{AsyncFunction3()}
# Get task to query / give commands to
# starts and continues independently
Task2 := spawn{Player.MoveTo(Target1)}
Sleep(1.5) # Wait 1.5 Seconds
MyLog.Print("1.5 Seconds into Move_to()")
Task2.Await() # wait until MoveTo() completed
Wait(0.5)     # Wait 0.5 Seconds
# Explicit start and wait until completed
# Task1 could still be running
Target1.MoveTo(Target2)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in