Sound not playing where I walk with my weapon

When I spawn in and start firing the gunshot sound is loud but when I walk away it stays playing at the spawn point of my character. I’m looking to play it where I walk and play when I hit the mouse button. Thanks

Simply attach the audio source to the feet of your player.

Create a empty gameObject under your player gameObject then that audio source to this gameObject. you can manipulate the volume of two different source of gunshot and walk.