Language

MuzzleFlash not working

please help i followed narutoisgreat1234's tutorial about muzzle flash exactly. but when i shoot the muzzle flash goes in random places like up down left right and sometimes even off the camera. how do i make it so the muzzle flash sticks to the barrel. it is a particleemitter and is 3d not a 2d plane. he is my script for the muzzle flash: