Hi,
Then this is what you need. I am not sure then where is your problem. Tho for efficiency, I would look into using particles for your machine gun bullets and maybe use a raycast to know if you are hitting a target. depending on the firing rate, you will kill performances by spawning a new prefab for every bullets ( you could use a pool manager for this, but that would not solved everything).
bye,
Jean