Hot to get variable from task to parent GameObject

Forums 💬 NodeCanvas ⚙️ Support Hot to get variable from task to parent GameObject

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15938
    p0rkskratchin
    Participant

      Hi,

      I have a variable (currentWaypoint) that gets set in a custom Evade action.  The action is defined in a Tree that is attached to my Player object.  Is there a proper way of accessing the currentWaypoint value from my Player object (I.E by bubbling it up through blackboards)?  I want to draw a Gizmo when the Player object is selected for debugging purposes.

      #15939
      Gavalakis
      Keymaster

        Hello there,
        If you mean accessing blackboard variables from code, then yes that is very possible using the blackboard methods. For example
        GetComponent<Blackboard>().GetVariableValue<Vector3>("currentWaypoint");

        Please let me know if that is what you mean indeed.
        Thanks!

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