Stun Mechanic against Player : missing something easy for boolean

I know I am missing something really easy here, but I can’t figure it out. What I want to happen is WHEN “box” collides with “stun collision” AND when Player Pawn is within that “stun collision” box, it disables the pawn’s input.

I have everything working other than the correct boolean. I tried a few different things and I am stuck:( I want it to check for the player’s position when they collide, if the player is within that stun collision box at that time, it stuns the player. If not, nothing happens.

If I can’t do it within the Actor Blueprint itself, then fine. It would have just been a little easier I guess. This is just one level, and it only would happen on this level. I have a decent understanding on how to communicate to actor blueprints from level blueprint (or any other BP) if needed.

Hey…. Not sure if I fully understand what your issue is but here goes anyway :slight_smile:

Can you not just set a boolean variable when the players collision box overlaps (enters) the area where the stun event is possible collision box and clear the variable when the player leaves?

Then when the stun event occurs if that variable is set disable the controller?

Also, I think you need to set the player controller pins on the enable and disable to the player controller you wish to enable or disable?

Um…yeah, I guess I really wasn’t thinking about it and I have never used the From Sweep variable in the OnComponentBeginOverlap… I thought I had tried it before posting this… anyways, I have it working now.

Also, Playcontroller must be taking the default controller for the gamemode, I didn’t have to plug anything in for it to disable and reenable the controller.

Ah, but how do I clear up the variable, that’s my new problem;)

Im not sure what the from sweep does…. I was more thinking along the lines of you have a bool variable, say CanStunPlayer which defaults to false

Then use ocomponentnbeginoverlap and oncomponentendoverlap events when the Player Capsule overlaps your stun area TriggerVolume to set CanStunPlayer to true and false respectively. This should manage the state of the variable

Use CanStunPlayer in you stun event to determine whether or not a stun will effect the player

So, I am so close, but it’s not there yet. Stun still goes off, even if BOTH bools are NOT true… am I doing something wrong with the execution? It is supposed to check if both BOOLs are True then go and if ONLY one is true, nothing happens right? Well, If I jump into the collision box, it will stun me, everytime I jump and land myself, it stuns me. The bool always returns true, unless I am not jumping and not on the collision box. grrrr

So I think what is happening is that the PawnInRange bool is behaving correctly, it is true whenever the player is on the collision box and false when not.

But the BothCollide bool once set the first time will always be true. Whatever the event for your boss arms to not be in the both collide condition needs to set it back to false then you will be free to move around the collision box without being stunned until the boss arms cause the both collide condition to occur again

Make sense?