- Home /
Attempting to make rigidbodies clump together, as if in a ball.
Hey everybody, new fish here.
I'm trying to use AddForce to clump a bunch of rigidbodies into a ball. Kind of like Me and My Katamari, but they shouldn't stick in place like that game, just be held together. Right now I'm basically doing AddForce towards the center of the ball multiplied by the distance and a damping value, but that's giving the rigidbodies a little orbity behavior instead of just moving the first one to the center, moving the next one as close as it can to the center, etc. as I would like. It's probably important to know that the center of the ball is going to be being moved around fairly quickly in the game.
Right now, my systems works using a set of two colliders, one for pulling objects in, and one for keeping them within a radius. I'm iterating through an array of all the objects that need to be clumped (these are pushed to an array in a manager script by the "keep" collider) and just applying forces to them, so really all I need to figure out is the few lines of code I need for actually applying the force.
Your answer
Follow this Question
Related Questions
addforce seems inconsistant 4 Answers
Trying to use colliders on trees to interact with player 1 Answer
Add force problem 1 Answer
Rigidbodies won't collide if mass difference is too high 0 Answers