How to make magnetic parts

I want to be able to make parts attracted to a part when it is near OR negatively attracted which tries to oppose or get away from a part when it is near. I tried using Vectorforce/Lineforce on unanchored spheres but ended up scrapping the scripts entirely.

P.S. I want the parts to be able to roam around freely aka unanchored

2 Likes

just use a VectorForce or BodyForce to pull parts toward a point, kinda like a magnet. grab parts in range with GetPartBoundsInBox and apply a force that points to the magnet’s position. make it scale with distance so stuff closer gets pulled harder.

2 Likes

It sorta works, i gotta fix some things but ty!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.