Announcement

Collapse
No announcement yet.

How to get an array that a behavior tree can acess

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to get an array that a behavior tree can acess

    I'm trying to get an array that i can access in a behavior tree. I tried just making a new blueprint, adding an array, and casting to it, but when trying to cast to it it always fails. Casting has always been such a huge bummer for me. Every time i encounter casting i stand hours trying to figure it out i search everywhere, the documentation , forums, youtube, reddit. But in almost all examples, casting is either in a begin overlap event or in a pawn (so you just use get player character or player pawn as an object) Never, however have i seen the type of casting that i need. And that's casting to a blueprint (only one in the level) that doesn't overlap anything and isn't a player.
    Help please!

    #2
    So, you want to get access to an array that it's declared in a BP, which in turn exists in the level (one of a kind). Is there any relation between this BP and the AI (pawn or controller) that uses the BT?

    If not, then just "Get All Actors of Class", get the first one in the returned array and there you go.
    "I have harnessed the shadows that stride from world to world to sow death and madness."

    Comment


      #3
      I work with game instance alot. You can put the array in game instance while the game is running it will be accesible from everywhere easily.

      Comment


        #4
        Originally posted by EvilCleric View Post
        So, you want to get access to an array that it's declared in a BP, which in turn exists in the level (one of a kind). Is there any relation between this BP and the AI (pawn or controller) that uses the BT?

        If not, then just "Get All Actors of Class", get the first one in the returned array and there you go.
        I ended up doing that. My mistake was having context sensitive ticked and couldn't see all the options. Thanks anyways, much appreciated!

        Comment


          #5
          Originally posted by P19923 View Post
          I work with game instance alot. You can put the array in game instance while the game is running it will be accesible from everywhere easily.
          I will look into that! Thank you!

          Comment

          Working...
          X