Regarding the proper way to use "do once"

Hello. I am a beginner in UE (Unreal Engine). I am using UE for reinforcement learning. Currently, I am having an issue with the player acquiring rewards. I want the player to acquire a reward only once when a certain collision overlaps with a checkpoint using “OnComponentBeginOverlap”, but it is not working correctly. What I have done is as follows:

1: Using “OnComponentBeginOverlap”, I set the “overlap” variable to True when the player overlaps with a checkpoint. (First image) 2: Using “OnComponentEndOverlap”, I set the “overlap” variable to False when the overlap ends. (Second image) 3: In the “check reward” function, if the “overlap” variable is True, it flows to “do once”, and sets the “checkpoint overlap” variable to True only once (this causes a reward to be acquired elsewhere). The “do once” resets when the “overlap” variable becomes anything other than True, and the “checkpoint overlap” is also set to False. So, after touching a checkpoint once, the “checkpoint overlap” should not become True again until the “EndOverlap”, but it keeps becoming True while touching the checkpoint. What I want is for the “checkpoint overlap” to become True only once until the “EndOverlap”. (Third image) 4: I have connected the “check reward” function to the “event tick”.

To reiterate, what I want is for the “checkpoint overlap” to become True only once until the “EndOverlap”. If there is a better way, I would appreciate if you could let me know.



If you want the player to only ever get the reward once

The ‘check reward’ function would probably inspect variables inside the player, to see if they have the reward already.