Blackboard GetVariable question

Forums 💬 NodeCanvas 🗨️ General Discussion Blackboard GetVariable question

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14554
    pjohalloran
    Participant

      Hi,

      Hoping somebody could answer this tiny question i have about getting a variable value out of the Blackboard without having to cast from Object to the type of the variable. I must be missing something obvious here.

      So GetVariable<T> returns type Variable.

      Im having to do this:

      When i’d actually like to do this using “T Variable::GetValue<T>()” (and it seems like its possible):

      But Variable is a base class of Variable<T> and doesn’t have access to the GetValue<T>() call.

      Is there something i’m missing here? Sorry probably there is but cant see it!

      #14557
      pjohalloran
      Participant

        Probably we are meant to use “Blackboard.GetValue<T>(string key)” and avoid where possible getting variables directly?

        #14556
        Gavalakis
        Keymaster

          Hello,

          Yes, getting the variable value from the blackboard is better done with:

          🙂

          There is no good reason to get the “internal” usage ‘Variable’ object unless you want to store it.

          Cheers!

          #14555
          pjohalloran
          Participant

            Ah cool, thanks!

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