I’m making a puzzle game and I’ve added a button. But when I press the button, it gives an infinite loop error.
The code of button
I’m making a puzzle game and I’ve added a button. But when I press the button, it gives an infinite loop error.
What is the size of sphere collision? It seems you need a “do once” node before adding offset. Also, it seems that the offset is greater than collision radius, so everytime your character enters the collision radius, adding offset to the “static mesh push” pulls player away from the collision sphere, then triggering an end overlap event, which pulls player back, and this cycle continues without breaks.
It seems that the static mesh push is forcing player to trigger sucessive overlaps.
Try to set collisions settings of static mesh push either as “ignore pawn” or “no colision”.
This kind of errors happen when a function A calls function B, but function B calls function A.
Make sure that you are not doing this.
It looks like
On begin overlap calls
Add world offset
Which in turn moves the object outside the trigger.
Which in turn calls On end overlap
Which calls Add world offset -5
Which makes it go back inside trigger.
Thus calling On begin And the process repeats indefinitely.
I can’t find a setting called “ignore pawn” or “no collision”. And no, offset less than collision radius.