Hi guys, im having some trouble with instantiate bullet shells causing lag. I want them to last for a long time, at least an hour(I know im an idiot). They work great, instantiate great, make a sound on collision and they stay there. Im using a capsule collider on them and everything is fine.
The only problem is if I stand in one spot and unload a few mags on full auto, I would say after about 90 shells are on the ground in that area I start getting some lag. Then it just gets worse. If I move from that spot, no lag.
I thought it was due to the bullet shells impacting each other, so i made a new physics layer called bulletshell, and set it to not interect with itself. Lag is still there.
Now im thinking a possiable solution could be to just limit the number of shells withen a certain range of each other. So if the newly instantiated shell on collision is 3 inches from another bullet shell it will destroy itself.
Anyone know how to delete an object based on its distance to another object of the same type?