The “executedCount” is automatically reset to 0, whenever the graph is stopped (OnGraphStopped called).
Do you need to reset it manually for some reason?
Please let me know.
Thanks ๐
Ok, so I have attached a small portion of my graph.
So if you look at it, when my bot dies, the navmeshagent is stopped but I assume this is not a one time call but rather called for as long as my bot is dead.
So since it’s not a one time call, I added a Filter node for when my bot is respawned. So when my bot died again, I’d like to restart my filter “executedCount” back to 0.
But I’m not that great in behaviour trees. If there is another way to achieve this, please advice.
Do you actually disable the bot gameobject when it dies?
If you do disable the gameobject, then the graph would also stop (and re-start when the bot gameobject is re-enabled again) and will thus also make it so that the tree is not continuously running even though the bot is dead. Also, Stoping and re-starting the graph (which can be a result of disabling/enabling the gameobject) will also reset any node “flags”, like “executedCount” is automatically.
For example, you can add the action “GameObject/Set Active” on the action node on the right (the node that is called when isAlive == false).
Please let me know what you think and if that helps (or not ๐ )
Thank you!
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.