How would you "Magnetize" a gameObject in a beginner-friendly way (if possible)?

Hello All,

I’m currently experimenting with a small 2D game, where a ball (affected by Unity physics) is shot from a cannon, bounces off a few platforms, picks up a few power-ups, and makes it to the target. One such power-up would give the ball magnetic properties, so that it sticks to an object/platform but doesn’t have its force stop (it’ll continue to move, but around the platform). I’d want it to still be affected by gravity, so that if, for example, the magnetized ball is moving towards the top of a giant circular platform but doesn’t have enough force to do so, it would roll towards the bottom of said platform. The only real-world example I could think of to aid my atrocious explanation are those magnet ball toys, when you roll them down the side of a fridge (it’s falling and being affected by gravity, but still stuck to the fridge, however enough force would overpower the force of the magnet and make it fall off the fridge.)

I’m a beginner programmer, so you’ll have to excuse me and explain any answer in simpler terms. I realize I’m potentially asking for a whole lot in a single answer, so thanks in advance. :slight_smile:

Use the PointEffector2D on things the ball can be stuck to. Set it to only affect the layer the ball is on. This way, the ball will be attracted to the them using a specific force of your choosing.