This event is called every time you pick up a weapon, I did a lot of tests with print strings and I can see the first time it’s called it runs through perfectly, it loops when it needs to and the delay works just fine every time.
The Second time it’s called though it gets to the delay node and just stops. A print string right before the delay will get called but nothing after the delay will get called. I don’t get any errors or anything. I tried this same code with retriggerable delay but get the exact same outcome.
But isn’t that what a retriggerable delay is for, every time you call it it restarts the delay timer? Because retriggerables don’t work either.
Also I get what your saying with the delay ignoring new calls but I don’t see how that is relevant in this code, you call the event initially and then it loops until the event finishes by spawning a new actor. Once that happens the delay should work the next time it’s called right?
Hi there,
How are you calling that event Respawn Pickup? Are you using a “for each loop” or something?
If so, loop macros will not work with delays, so you need custom macros.
Whenever you pickup an item on the ground the item is destroyed and this Respawn Pickup function is called.
The idea is that the item will respawn but only after a certain amount of time and only if the player is not nearby. The only loop is if the weapon is trying to respawn but the player is too close, the weapon will wait X seconds before checking player distance and potentially respawning
I don’t really understand what you’re saying. I have put different values in the delay but it’s always the same thing.
The first time the Respawn Pickup is called it works perfectly, even if the branch is true it will loop the proper amount of times until it respawns and the loop ends. BUT, the second time that Respawn Pickup is called the code just stops running at that delay node.
Waaait, you’re saying that this code is in the object that’s being destroyed? Are you trying to use a latent function (delay in this case) after you call destroy on this actor?
Turns out that the weapons that I was setting to hidden were also getting destroyed later on. That explains why it worked fine initially but not the second time.
It’s very helpful to take a step back from the code while someone else takes a look at it to point out all the obvious sh*t that Cleary won’t work.