Moderators wouldn’t unlist or delete this topic so here’s the next best thing.
Why are you making a new Touched
signal every time you fire a bullet and then immediately destroy the signal afterwards? No need to do this. Literally just register your weapon.Mesh
and instantiation time so that the TouchedInterest
instance is created. Creating and destroying instances is expensive. Doing it constantly is even more expensive.
Same thing with sound. Every time you fire a bullet (which will probably be a lot in a gun shooty game) you create and destroy a Sound Instance. Just instantiate 10-20 sounds (or take the maximum shots per second and multiply it by five… maybe less if you want) and put them in your gun. Then make a ring-buffer that cycles through your sounds every time you fire. You then don’t need to constantly instantiate and then destroy instances every few hundred milliseconds if you are lighting someone up. You also avoid needing to replicate all this instance creation and destruction to every client, freeing up your network.