I’m using a custom NPC. I wanted to make some footsteps sfx while my NPC was walking, so I made this code:
var NavRes : navigation_result = navigation_result.Reached
Task := spawn{NPCNav.NavigateTo(NavTarget, ?MovementType := movement_types.Running, ?ReachRadius := 120.0)}
spawn{LoopFootSteps()}
Task.Await()
set NavRes = navigation_result[Task]
Basically I make the npc walk towards the target and play a loop of the footstep sfx until he reaches the target, using Task.Await().
But since I need to do certain things following certain situations, I need to access the value returned by Task := spawn{NPCNav.NavigateTo(NavTarget, ?MovementType := movement_types.Running, ?ReachRadius := 120.0)}, which is a navigation_result value.
My problem is that I don’t know how to access the navigation_result returned by this function.
Task is a variable of type task(navigation_result) but how do I access that navigation_result value?
I’ve tried on the last row (set NavRes = navigation_result[Task]), but it doesn’t work.
Help would be appreciated