Set Boolean from notify event not working

I have a notify whenever my enemy will attack to tell the player when the attack is coming. I want to make this T/F statement set to true so that it will fire from a different line of code. The notify works just fine and will go all the way to my “Set L to true” but for some reason it doesn’t actually set it to true and keep the value. It will still read false. I’ve debugged it by putting a string after “EvasionalLFinal” and it fires it just fine.

Same with the “Q” key. Upon using Q, it will set “L” to true and keep it. But when using the notify to fire everything, it won’t make “L” true. I’m pretty new to UE5 scripting so please if anyone could help me with this it would be great. I’m just so confused on how it doesn’t make it true even though it will fire off a string and everything. It’s really odd

Replicated variables have to be set on the Server.

1 Like

Will try when I get home. Thanks for that!

However I will say. I should’ve said it earlier but this variable is ONLY inside my combat component and only exists in there so would server replication even matter for that? I’m only trying to set a variable to true once I fire a notify from my animation.

It works perfectly fine firing anything else but just not setting the variable to either true or false.

Well you aren’t actually using a notify.

The second image isn’t setting the return to true. Static False.

Okay I set the return to true and still nothing changes. Set the variable to replicated as well :confused:

If I put a branch after the variable it will read it being true and not false. Though when I try a branch with it when another event fires, “L” will be false. No other component is changing the value of L at all besides the “Doesn’t work” thing I have set up

I’m just so confused on how a variable being set to true comes out as true but doesn’t actually keep the value of true for other instances. By running any other event in the same blueprint, it will set the value to true and keep it. The notify will set it to true but not keep the value.

It looks like your animation notify is firing, but the boolean isn’t sticking. try switching to an anim notify state, which gives you both a begin and end event perfect for reliably setting a bool to true and then resetting it later. that approach tends to work more consistently than a simple notify.

Alrighty, will give it a go later. Was going to try a state but I just assumed it would work with a simple notify

Yeah, just does the same thing. Was worth a try but still doesn’t keep the value. This is so weird, I don’t understand how a variable being set just gets ignored when an event is calling it from another blueprint. (This picture is inside my enemy blueprint where it receives the notify and calls the set event in my combat component)

What i understand is…Get Owner is the enemy right? because you use Does object implement interface bpi enemy. so player evade L interface is run on the enemy, not your player.

Yes, my enemy is doing the animations and the notify is inside my enemy animations so it needs my enemy’s interface. The thing I’m doing here is calling the interface event from my notify as a message which sends it back to my enemy blueprint which will then fires an event running inside my “BCA Combat” which both my enemies and player are apart of. I will try it the other way to see though

Yeah, if I switch it around to my player’s info, it won’t call the notify event. The owner is my enemy so it needs to be my enemy receiving everything to send to my combat component. Thanks for trying to help though!!

Is bca_combat an actor component on each char or some third actor somewhere in the level? If each actor has the combat comp, the anim notify should probably call an event named attack_telegraph or some such (name itself doesn’t matter, would just make it easier to follow logic while debugging :wink: ) and have that event send an interface message to target with a bool and let the interface function on target decide whether to dodge.

As for bool itself not setting, it is set to instance editable, right?

BCA_combat is an actor component that the player and enemy both use. (In their components tab) Also when you say “send an interface message to target with a bool” do you mean create an interface event lets say inside my “Enemy_info” interface. Add the event from the interface tab of my enemy blueprint event graph and then add the bool in the enemy’s event graph? Currently all my animations for gameplay have been made inside my combat component and my iframes for my evasion are also in there. This is why im trying to set the bool in the combat component so I can tell my evasion if it has roll frames or not.

And for the bool not setting, yes it’s instance editable. It’s such a strange matter since I’d assume setting a bool to a value would keep it’s value in my combat component. It works just fine when I use a debug key inside my combat component, just this event trying to fire it off doesn’t want to keep the value. (you probably already read above but print strings and any other events will fire just fine, setting values however makes them reset to their default value)

I’m pretty new to blueprints myself but this is a first for something seeming super simple to not work.

Yea, add a function to your enemy info interface called Dodge? or something. Implement it as event or function inside the characters, and use message to call it.

Anim bp notify event would be like this:

That’s triggered with notify at frame 1 of attack anim.

Then character bp would have something like so:

In my case I’m using a master character class which player and NPCs are children of. But you could implement the dodge event differently on every char who uses the interface and give it more logic than just jump lol.

May also want more logic in telegraph event like distance to target so it doesn’t warn a player who’s off in Ohio somewhere..

Makes sense. How did you get this “AnimNotify_AttackStart” event though? When searching for an event in the anim notify bp I only get casting nodes etc…

If you right click an empty spot in an anim bp it should have add anim_notify_event options for all notifies on the skele:

If the notify in your montage wasn’t saved to the skeleton because reasons, untick context sensitive and it should show every notify known to the project.