Adjust the model of the character by separating the head and body and making 2 holes for 6mmx2mm cylindrical magnets 8 mm apart (or use the model of the exact size of magnets given).
Fix magnets in the slots and attach the spring to the head and body magnetically.