Bool variable from Character BP is not updating in Animation BP

Hello,

I have a boolean in the Character BP that determines if the weapon is unsheathed (true) or not.


This variable is set after the “Event Pick Up Weapon” happens. This is a BP Interface that is called in the Weapon_BP as follows:


Finally, the variable is called in the animgraph from the Animation Blueprint in order to affect the outcome of a blend poses by bool.


The thing is. In my character_BP the bool is switching from true to false correctly and vice versa. But this is not happening in my animation BP, it always says false no matter what, so the animations do not blend. I have other variables casted from my character BP to the anim BP Event Graph, which are floats, but they are being updated correctly.

I have tried to create bool in event graph of animation BP and set it to the value of the bool of the character BP, then use it in the AnimGraph. But it does not work.

You (probably) will have more variables in character blueprint that can change.
Make struct, add all of them there… Make dispatcher, fire it every time variable changes.
Hook to dispatcher in anim blueprint and process it.

I know its not optimal, but as long as you use it for just player character it makes easiest code, because you have single player character blueprint ant dingle anim blueprint.

Or you can make separate dispatcher for every variable that changes.

ps.
also try to find exact reason why it does not update. Print to log variable state, see if its problem of communication between blueprints or maybe something else. Split whole thing into pieces and see which one fails.

pps.
More of a hint. Your code is not actual spawned, constructed and running code. Code you have in blueprints is like declaration of code (mold or recipe) code that runs is actually running on actor that is spawned, you may have messed up references somewhere.

Thing like dispatcher will force your code to point at actual actor, or it will fail to execute.
First do prints that say “self”>display name> and then print who it is processing that code.

Simply find where it fails, by checking every part of it.

Print if all pieces of code are triggered, and name of actor that has it. You may send/call events in wrong actors, or even call event with wrong reference to actor that does not exist

Thanks.

But nevermind, I don’t know what did I do but now it works.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.