How to stop prefabs instantiating at random locations

I have a “Gun” that has a “GunEnd” where the bullets fire out of. For some strange reason the bullets fire at three different locations all at random, at one point it’ll come out of the “GunEnd” but sometimes it instantiates at random along the Y axis. I’ve tried different ways off instantiating but nothing works.

Check your gun.transform.position by logging. If that is changing in Y axis too then the bullet’s position will definitely change in Y.

Also use Quaternion.Identity instead of gun.transform.locaEulerangles