Why does my character move randomly

Perhaps the gun is colliding with the player? Set the gun’s collision to Ignore Pawn.