Run tree from code?

Forums 💬 NodeCanvas 🗨️ General Discussion Run tree from code?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13065
    brad_bit
    Participant

      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.

      #13066
      Gavalakis
      Keymaster

        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.

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