How to populate a Patrol task's waypoints dynamically?

thretch

Member
I have a patrol task, and since it's in a prefab that gets instantiated, the waypoint list is empty. Been googling for an hour, no closer to finding an answer. What is the best way to populate the waypoints list after instantiation?

I have waypoints all set up in the scene, tagged as waypoints, and a parent of all of them named "Waypoints".

Thanks!
 
This is the crux of the problem, I think. Why can't I create a variable of type SharedGameObjectList and then reference it here? Why are no variables available here at all?

1569761995861.png
 
OK, solved that particular part. I'e found 24 hours of banging your head against a hard immovable object helps. Solution to that part: create a variable of type SharedGameObjectList (how hard was that??).

Next part, the "Find Game Objects With Tag" task is not finding any of the tags I am trying to find to populate the waypoints. They are definitely there, but it's coming up empty.

1569766371119.png

In this case, the find with tag task tries to store the result in the SharedGameObjectList variable, but when I log the size, it's zero, and the Patrol task throws a bunch of NullReferenceExceptions.

More head bangin'...
 
Top