Set parenting based on distance?

Hey guys, for reference I`m linking this video from Katamari:

I was trying to recreate this effect with physics but it`s bit glitchy. I wonder if there’s a way to set the parenting of multiple objects based on distance.

Thank you!!!

Not just with distance. (Because distance from sphere to what? You don’t want it grabbing and then letting go as that distance to the pre-parented object increases.)

But in general, you can do this with a child-of constraint. It’s not entirely automatable without scripting-- what you need to do is set the influence of the child-of constraint to 1.0 when the distance is small enough, but then never drop the influence on later frames, which either requires some hand-work (possibly, from baked values), a lot of copy transforms constraints and 2 bake passes to avoid dependency issues, or some scripting.

Damnnn, sounds really complicated ahhahaha. Thanks for replying. I was thinking something like

IF (Location A) - (Location B) < 0,01m THEN Parenting is ON

And the parenting would remain ON all the time.

Also saw that there’s an option to do exactly this on the Blender Game Engine inside the Game Logic, compound physics was the name

That’s the part that you can’t do without scripting (or an addon). Drivers don’t know what happened last frame. And unfortunately, BGE is no longer around.

1 Like