How would I make a smooth weapon charm?

I know how to code everything, but I don’t know how I would make the charm actually move and not just be welded to the weapon. I want it to be smooth and not janky.