Hello
I created a simple patrolling AI with the following layout and I created two shared variables for controlling that logic - waypoints (to store waypoint references, which could be places in the level and changed when placing prefab in the level) and currentWaypointIndex (to store current waypoint index).
My question: Is it possible to somehow hide temporary/state related variables like currentWaypointIndex in the Behavior tree component, which I don't need to edit when I am placing patrolling enemy prefab in the level. I would only need to change the waypoints array.
Or should I approach patrolling AI logic somehow differently?
I also looked up, another way to solve this issue could be by using task references (https://opsive.com/support/documentation/behavior-designer/referencing-tasks/) - create currentWaypointIndex variable in task SetNewPatrolPoint and reference it in MoveTo task. But this creates a problem with the reusability as I now need to always have SetNewPatrolPoint task reference in MoveTo task.
Any advice with this problem is much appreciated.
Thank you in advance.
I created a simple patrolling AI with the following layout and I created two shared variables for controlling that logic - waypoints (to store waypoint references, which could be places in the level and changed when placing prefab in the level) and currentWaypointIndex (to store current waypoint index).
My question: Is it possible to somehow hide temporary/state related variables like currentWaypointIndex in the Behavior tree component, which I don't need to edit when I am placing patrolling enemy prefab in the level. I would only need to change the waypoints array.
Or should I approach patrolling AI logic somehow differently?
I also looked up, another way to solve this issue could be by using task references (https://opsive.com/support/documentation/behavior-designer/referencing-tasks/) - create currentWaypointIndex variable in task SetNewPatrolPoint and reference it in MoveTo task. But this creates a problem with the reusability as I now need to always have SetNewPatrolPoint task reference in MoveTo task.
Any advice with this problem is much appreciated.
Thank you in advance.