Problem with fixing the bug

Hello, this is a blueprint code that is used to check whether a timer in another blueprint has finished or not, and then open a door if the timer has ended. However, I’ve encountered a bug: if the character is constantly within the script’s zone, it doesn’t trigger and doesn’t open the door. I want to ask if there is a way to loop the check of the Vsempoka variable or modify the code to fix this bug (simply using Event Begin Play is not an option because the variable is located in the character’s code, as it connects the two scripts together). If more screenshots are needed, let me know, and I’ll send them.

I assume the Overlap from “Proverka” is a collision component with OverlapAllDynamics profile. This has Collision Enabled set to QueryOnly(NophysicsCollision).

You can kind of force an Overlap test for that component when your timer finished by using SetCollisionEnabled: set it to NoCollision and directly after back to QueryOnly(NophysicsCollision).

The next frame the overlap should trigger as many times as there are objects already inside the collision.

1 Like

Thank you very much, however, there must be DELAY otherwise a mistake about an endless loop is given

I think there is a cleaner way using Event Disptacher, if you like :wink: I assume the timer you were talking about is in BP_ThirdPersonCaharacter and the door has the “Proverka” collision.

  • Setup an Event Dispatcher in BP_ThirdPersonCaharacter (example name: OnTimerFinished) that gets called when the timers has finished.
  • When “Proverka” triggers begin Overlap and the bool is false, bind a custom event to the OnTimerFinished from your BP_ThirdPersonCaharacter. That custom event can do the deactiavtion + reactivation of the “Proverka” collision.
  • Add an End Overlap of the “Proverka” collision. From that node cast OtherActor to your BP_ThirdPersonCaharacter to unbind the custom event again.
1 Like