Hello! I’m trying to make a landmine, all it’s working but when i tried to make ‘chain reaction’ for my landmine, it’s just giving me infinite loop error… i also tried to add delay and branch + boolean, but nothing. What i am doing wrong?.. how to make right chain reaction for my mines?
Hey @Lizzy_Holz!
What is this infinite loop error you’re talking about? Can you get that for us? It’ll be really useful determining what’s happening- it might not be here that is the issue.
Get back to us!
I think this is not your entire code that’s related to your “chain reaction” because I don’t see a loop here, and there isn’t much context. Or am I missing something? Could you please clarify what’s going on?
The only iteration that I can think of here is the On Component End Overlap node being called repeatedly, which you can fix by using a Do Once node.
I don’t think it will solve the issue if that’s the case, but you can also consider increasing the Max Loop Iteration count setting from the project settings if there’s a correctly applied loop that gives the infinite loop error when it’s not supposed to.
OMG @Mind-Brain this is the second time we replied at the exact same time!
so i have two landmines, one of them is activated by ‘enemy’ (simply an actor with health, and event ‘any damage’)
when this actor steps on the landmine I just get an error (see pic)
also another pic with my landmines on the landscape
What happens when you place a Do Once
node right before you trigger that spawn node?
it’s fixing ‘infinite loop’ But if i use ‘Do Once’, I can’t trigger a chain reaction for my mines (or maybe i don’t know another way how to trigger mines by using damage from another landmine) also sorry for my very bad english, I really don’t know how to explain it better
Could you please clarify how do you handle that chain reaction? You should be able to achieve that just by using the Cast To node, selecting your landmine blueprint from the dropdown menu inside that node, connecting a For Each Loop node to the Cast To node (their square blue pins should also be connected to each other along with their white execution pins) and calling a function that trigger the explosion or whatever you want it to trigger after the Loop Body pin of the For Each Loop node. You can handle this in the character blueprint of your enemies or the player.
Hope this helps!
okay, i will try to clarify ;D
Here i have two nodes, end overlap it’s for enemy or another player, when player or enemy go out from sphere collision landmine will detonate.
and also i have here event ‘anydamage’ when landmine receives damage from another landmine, this event calls detonate logic, in this detonate logic i have radial damage Which is supposed to trigger the chain reaction.
it’s something like… player can spawn landmines, if enemy or another player steps on the landmine, it will detonate, BUT if player spawns 2-4 mines next to each other, and if player (or enemy) steps, all mines needs to detonate, because i am using radial damage.
and yes, i tried to use cast, but it’s not working…
I have a suggestion that I can’t use ‘AnyDamage’ and ‘RadialDamage’ in the same blueprint but I’m not sure about this suggestion
Try to put your DoOnce like this.
What’s happening is it’s triggering multiple times before DestroyActor gets it’s chance, I believe.
Give this a shot and let us know what it does!
Now it works! I think I used ‘Do Once’ incorrectly the first time, but now everything works great, thank u very very much!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.