Accessing GlobalBlackboard Variables from C# script

Forums 💬 FlowCanvas ⚙️ Support Accessing GlobalBlackboard Variables from C# script

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11973
    spayke
    Participant

      Can you please give example of how to get Global Blackboard Variables, from C# script?(couldn’t find it in documentation)

      Also if there will be script on many scene gameobjects, can C# script get Global FC Variable without setting that blackboard field to the each script manually? For example how other FC scripts can see Global blackboard vars, so maybe C# script somehow can see them too, is it possible?

      Thank you

      #11976
      Gavalakis
      Keymaster

        Hey,

        You can get a Global Blackboard’s Variable like this for example:

        In the ‘GlobalBlackboard.Find’ you have to pass the identifier name of the Global Blackboard (as set in its inspector). Then you can use the ‘GetVariableValue` method to get the value of a variable. T has to be the type of the variable and you of course have to pass the name of the variable as the example above 🙂

        Let me know if that is what you were after. Thanks.

        #11975
        spayke
        Participant

          Yes, this is exactly what I needed, thank you!

          #11974
          Gavalakis
          Keymaster

            You are welcome 🙂

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