Player dies no matter what

So I have a loop that counts up to six and then triggers an event that will kill the player and can be stopped when the player interacts with the vent but for some reason even if you interact with the vent you die. I’ve been trying to figure this out for like 2 weeks now and I cant seem to find the issue.
This is my first game so sorry if this is bad

This is the Vent loop

and this checks if your near the vent

Hi @SylviSlime , welcome to the forum!

I see a couple problems with the blueprint that may be the cause of your issue.

  1. You only reset TimesCrawled if it’s already 6, with a delay that checks for a bool (Knocked) that only gets set to true if TimesCrawled is already 6.

Although in theory this could somewhat work, it’s never a good a idea rely on delays to check for conditions.

  1. Knocked is only set to true if TimesCrawled is already 6 at the moment of interaction, so the only way your “don’t die” conditions is set to true is if a very specific time-sensitive condition is met.

  2. Knocked is only set to true if Nearvent is true, which only happens if TimesCrawled is true at the moment of BeginOverlap. Again, same time-sensitive condition very hard to predict.

So, to solve this (although I don’t know why TimesCrawled == 6 is a requirement), the simplest solution is to set Knocked to true on BeginOverlap without checking for TimesCrawled. Or simply use NearVent with the same approach, set it to true on BeginOverlap without checking for TimesCrawled.

Then reset TimesCrawled and don’t resume the “loop” until OnEndOverlap.

Also, on a side note, I recommend using timers instead of delay, and you don’t need to Cast to your player BP and then compare “OtherActor” with “Self”. If it’s single player, just one of them is required. If it’s a multiplayer game, you can just use “IsLocallyControlled” to determine if it’s the local player.