Passing information between Dialogue Tree and Scene

Forums 💬 NodeCanvas 🗨️ General Discussion Passing information between Dialogue Tree and Scene

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #13789
    cgraf062491
    Participant

      Here is my action task. I have a separate method to EndAction that I want to call in a different script that looks like this.

      I keep getting that Null reference exception, so I guess my question is, how do I reference the action I want to end, if EndAction() only takes a bool?

      #13788
      Gavalakis
      Keymaster

        Hello again,

        I think it would be better if you try to achieve what you want by using some sort of static events, in which the ActionTask can subscribe to instead of trying to get a reference to the action task object itself.

        Here is a very rough example of what I mean:

        You could also turn the above example into some kind of a “manager” if you’d like.

        Then in your action tasks, you could subscribe to the event in the OnExecute method like this:

        This way, and by using events in general, you don’t have to worry about referencing everything. 🙂

        Let me know if that works for you.
        Thanks.

        #13787
        cgraf062491
        Participant

          Hello,

          Sorry for the late reply, but I have been working a lot because that finally did it! Thanks so much for all your help.

        Viewing 3 posts - 16 through 18 (of 18 total)
        • You must be logged in to reply to this topic.