Question about structs

Forums 💬 NodeCanvas ⚙️ Support Question about structs

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16723
    d_gamer
    Participant

      Hello,

      I have a simple struct that Ive added to the preferred types.
      Example:

      public struct planets
      {
      public Collider plan_sphere;

      public int Planet_Index;

      public float Distance;
      }

      I can add this struct to the blackboard or as a list to the blackboard just fine.

      My question is, how would I go about accessing a single field in the struct, plan_sphere for example and save it to a collider variable on the blackboard.

      As far as I can tell in the blackboard section of actions there is: Set Variable (T).

      This allow us to write to the struct, is there a method to “Get” a single field from the struct?

      Thanks in advance.

       

      #16724
      Gavalakis
      Keymaster

        Hello there,

        Unfortunately that is not possible right now :/
        While there is a “Get Property” and a “Set Property” task in the “Script Control” category, these only work with UnityEngine.Component type of variables on the blackboard. With that said, I do want to make those work with any type of variable in the future, even though it will require a lot of refactoring to achieve that.

        Thank you.

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