Moving along something logic

So imagine there’s a circle collider or an edge collider (2D) and there is another little ball with a circle collider attached to it. I can’t figure out how to script this whole thing that when a ball touches that circle or edge collider it begins to move along with that collider, well let’s say there is a planet and i want to make a moon to fly around that planet. Any suggestions?

Mhh. I am not on a PC with unity atm but for your planet example you could make your moon a rigidbody and add a velocity to it. now check with ray casts when it hits a planet within a given distance. if so. you could make use of things like centrifugal force and centripetal force. You can find mathematical formulars for them at the internet. And use the “force” feature of the rigidbody so it will look a loot smoother and more realistic. The moon will fly around the planet when centrifugal and centripetal force are equal. hopefully this was helpfull :slight_smile: