Multiple hits (1-10) at once with simulating physics objects


I have a big problem with multiple hits at once with simulating physics objects. When my physics objects hit something and bounce off, the Hit-Event triggers up to 10 times at once. I had to make my own component to forbid Hit-events for a short duration after a hit to prevent that, but with much physics objects triggering so much hit events is also very imperformant.

Thank you,


Hits and overlaps are a messy thing. You have to write that into your code, best thing is a DoOnce node. When the hit occurs, use DoOnce, deal with the hit, and when you’re ready, enable the DoOnce again.

This is basically what my component makes. But it’s not only messy, it’s also imperformant. Consider 100 physics objects colliding with something. This means up to 1000 triggerings of the Hit-event. If physics objects come to a halt on the ground it’s triggering every tick I guess, so at 100 fps with 100 physics objects this are 10.000 triggerings of the hit-event per second what for sure can cause fps-drops.

Not with DoOnce. Once the node has run, nothing happens.

I think that the pure event calls, whether the events do something or not, will cost performance.

Yes, a bit, but nothing like piling through a load of redundant login every tick. Which is what you get to see a lot on here… :slight_smile: