How to change flipbooks via ai behavioral tree

Hello

Is there any way to change flipbooks in 2d ai character in its behavioral tree? I keep wondering how to approach this problem. In fact I should ask this question differently: How generally change flipbooks in 2d ai Character?

To do it via BTs all you need to do is to create a BT task or a BT service (only nodes that do actual work) and have them do the flipping.

Regarding general approach, I’ll leave it to someone that knows :smiley:

I’ll try this out as soon as I get my hands on the keyboard. By the way: it’s really nice to get a reply from You! :smiley:

So… after many tries all I can do is simplify my question to: how to get an actor flipbook component and set its flipbook in the behaviour tree. I assume the best (and maybe the only) way to do this is via Service. Still no idea how to make it happen. All the topics that are related to this one have no answers either.

What I’ve done is:
Behaviour Tree is setting a different name variable for 3 different actions. Actions are: Idle, Combat and Searching.
If player character is in line of sight it’s Combat and name variable is set to “Combat” aswell.
If player character isn’t in the line of sight it’s Idle and name variable is set to “Idle” aswell.
Searching is just running to the last location where player has been seen. Name variable is set to “Searching” aswell.

Name Variable is saved as BlackboardKey.
What I’m struggling with is how can I get thisFlipbook Component out of AICharacter.

It’s working now :slight_smile: If anobydy is curious how I’ll share the solution.

I would like to know please sorry I’m a noob and learn from examples mostly and well there isn’t an example anywhere for me to learn form sadly. :frowning:

Seriously @Asterat, you yourself say that this is the only topic at that no other is resolved and you couldn’t post the answer?! :confused:

Well, since I had this problem and none of the threads I visited had the answer here it is:

You basically have to have an event at the beginning and end of execution. You just make the Variables public and editable and it’s easy to customize via Behaviour tree!

Cheers