How to access BT inside BT graph value?

Forums 💬 NodeCanvas 🗨️ General Discussion How to access BT inside BT graph value?

  • This topic has 0 replies, 2 voices, and was last updated 3 years ago by Gavalakis.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13036
    hatter041
    Participant

      I’m making a function to set graph variables and sub graph variables in runtime.

      In order to produce this function, in FSM, I could get the Current State and change the value in runtime, but I couldn’t know how to access sub graph BT inside BT and modify the graph variable. I want get current state at BT like FSM’s current state.

      I have already applied the method using PrimeNode, and it works but the value does not change Immediately.

      #13037
      Gavalakis
      Keymaster

        Hello,

        The difference in BT (in comparison to FSM), is that in a BT multiple nodes may run simultaneously due to a Parallel composite and it has no definite states like an FSM has.

        You could still however get a BT node from code. I would suggest tagging the nodes you want to get in code with a “tag” in its inspector and then use the graph.GetNodeWithTag<T>(string tag), to get tagged node.

        Let me know if this works for your use case.

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