Bullet shells causing lag / framerate drop

AHumanBeing

New member
Hello,

While testing the Demo Scene I noticed the framerate drops significantly when using a rapidfire weapon (Assault Rifle). I narrowed it down to being caused by the bullet shells and it seems more specific to the physics of the shells than anything else.

Basically when picking up the assault rifle an unloading the clip, I noticed the framerate would drop from 200+ fps down to about 120 fps or lower, that's almost a 50% lag while shooting. The framerate is restored after the bullet shells despawn which is another reason I think it has to do with the physics. I'm using the latest version of unity.

Is this normal or have you encountered this before? Is there an easy fix by chance?

Thank you for your time and excellent work.
 
Can you try profiling the demo scene to see what is causing the spike? What the drop may be from is when the Object Pooler has to instantiate a new object. On the Object Pool component you can increase the number of prefetched objects which should help in this case.
 
Top