cutting right to the point. How do I use a service to run a behavior every 30 seconds? This code is running infinite at the moment; rest of the behavior tree isn’t running. I just want this AI to perform this simple behavior once every 30 seconds. Any interval I place in the service makes it run infinite.
I reused the same decorator for this branch as the others because its a boolean check with different blackboard keys. Print Task is a filler task for the real one not implemented yet.
The service gets reset every time control flow leaves the BT sub-branch. This has been fixed in 4.8, but for now try putting the service up at the root.
Hmmm, the way I designed my behavior tree has an infinite loop decorator on the 2nd composite node; the first one will never be read again if I think I know behavior trees.
I tried on the 2nd composite node; attaching the service, but the infinite running of the behavior without running the other parts of the tree still exists.
You can try implementing a custom service that would be setting up and using a timer. Or you can have this logic in AIController class’ BP altogether or alternatively kept in sync with BT using blackboard. Not every single thing has to be done in BT