How to animate object target positions while respecting rigid body collisions? I would like to have about 20 shapes and animate the target position for those objects. The objects would try to reach those positions, but colliding with each other (instead of going through each other as ghosts).

Is that somehow possible, even if it involves scripting?



So far I've only figured out I can have a dummy with an attractive force, and then all objects try to reach that one dummy. But how could I have one target dummy per object?

Reading old posts I get the impression that one could have forces that are only active in one render layer. Using View Layers in Blender 2.8 doesn't seem to have that effect: the force seems to apply to objects in other view layers too.
The solution, indicated by Rich Sedman (thank you!), is to use Rigid Body Constraints with Generic Springs.


Create 3 cubes
Add Rigid Body to each cube
Create 3 spheres (will act as targets)
Add Rigid Body (passive) to each sphere. Mark it as animated and place it in Collections 2 to avoid colliding with the boxes.
Add Rigid Body Constraint to each sphere, type Generic Spring. Activate Linear limits in all 3 axes. For Objects set First to the sphere itself, Second to the corresponding cube. Set Stiffness and Damping for Springs &gt; Angular and Linear according to taste.
Put each sphere centered in a cube. If you place the cube under the sphere, it will be hanging. When you animate the sphere position the cube will follow, hanging under it. I wanted to avoid that, so it doesn't feel like marionettes.
Animate the sphere positions so they pass near other spheres. The Cubes will collide and avoid each other.
Disable gravity (optional).


What's missing for me is to figure out the right values for the constraints so the motion feels right.