Run tree from code?

NodeCanvas Forums General Discussion Run tree from code?


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #16459

    Hi! I’m building a game where AI controlled enemies are entities in ECS. I was hoping to run their AI using NodeCanvas every few seconds. Is it possible to hold individual tree states in memory and run the tree from code, without having a GameObject for each enemy instance? That is, I’d like to author the tree using a single GameObject, and run that tree repeatedly for each of the enemies, injecting their tree state in each execution. Is this possible? It would be a nice way to use the tool with ECS without having to port the entire thing to ECS.


    Hello there,

    In general, updating a graph from code is possible, but I am afraid that the rest of your questions are not. There is no built-in method to store the state of the graph and also, each agent (enemy) requires its own instance of the graph. A single/same instance of the graph can not be used simultaneously on multiple agents. Please let me know if that is what you’ve asked. 🙂

    Thank you.

    Join us on Discord:

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.