Pickup system not working properly

Hi guys.

I have created a BluePrint class for the Health Pickup.

I’m programming the respawn system, and it works… but very often it happens that the pickup respawns multiple times, when it should do only one time.

For example, I take a +15 health pickup and when it respawns I take it again… but it doesn’t give me +15, but much more (+30, +45, however, multiples of 15).

It looks like the pickup respawns more times than it should.

This is the respawn system:

This is the CalculateFinalHealth function:

Up, please!

Please check the forum link you posted earlier. The same 4 day rule applies here. We ask that you wait 4 days before bumping a thread as it causes unnecessary clutter and makes it much more difficult to help anyone as we have to parse through posts that add nothing to the original post. After 4 days from the most recent post, if no one has replied, please feel free to bump the thread once.

I think it’s not problem of respawn , reason why players health is increasing 2x3 times is that heal function is called 2 or 3 times and begin overlap event causes this. so after 1 call disable heal function on pickup item with one bool variable.

Hey, thanks for the answer.

Debugging the game, I figured out that the first time I take the pickup, the spawn delay is as I set: 2 seconds.

In the second call of the event, the respawn delay isn’t 2 seconds (as I set) but 0.5 seconds.

That’s the reason. I haven’t even the time to run away from the pickup, that it spawns again.

ALSO,

from the third call of the event and so on, the Debugger brings me to the FirstPersonCharacter Blueprint showing me these actions in progress:

Why this?
What’s happening?

I think your code architecture is not correct. When you are trying to hide pick up it is not stopping to detect overlap events so i think you need just disable this pickup or destroy and then spawn in another location from level blueprint

How can I do what you said?
However, it’s strange because before detecting for a new overlap, I set a DELAY.

Ho hey! Thank you very much it works!

Add just 1 bool variable called “Is Active” and set default value as true. Then on begin overlap event check if it is true and change value to false. After Set Actor Hidden in Game set Active to true. Good luck