Great work! I know exactly what video you are talking about, haha. I don't use any special formula, just the built-in Unity stuff. I pretty much just number/code tweak until I find something that feels good. In this case, I started with just a fixed number I set, the direction between two magnets, and the distance between two magnets. It felt decent, but I figured adding something more when they are very close would feel better, so if two magnets are very close they pull together stronger past a certain distance. If you are new to Unity physics, I would recommend just messing around inside of Unity with different built-in functions, objects, and values, then look into the theory. Theory is good, but won't make much sense until you have some practice in and often times takes the fun away from creating early on, in my opinion.