Clamp object to curve path

I’m trying to make two objects collision with complex movement. The movement curve was created and what was left is just to animate the moving object (cube).
This is the scene’s setup:

  • plane --> pasive rigid body
  • sphere --> active rigid body
  • cube --> active animated rigid body

What I want to achieve is the cube moving on the curve path until the collision with the sphere, after the collision I want the cube to detach for the curve and move naturally.
The curve is located at 1 in Z-axis this is because I want to clamp the center point of the cube to the curve path but when I clamp the cube to the curve path suddenly the center of the cube is turning to 0 in Z-axis instead of 1. Also, when I try to animate the cube by moving it using “g” the cube doesn’t move.

How can I achieve the desired collision?

enter image description here

Hey,

What you can do is :

  • In the rigid body params for the cube, check “animated” to allow the cube to be both animated by the curve, and rigid body active.
  • Then launch the animation a first time, to see at which frame the collision happens.
  • Go to this frame, right click on the “animated” checkbox, and add keyframe. Go one frame next, uncheck the “animated” checkbox and add a keyframe again.
  • That way, the cube would be animated before the collision, and free after.

Here is the result I got so far :

See you :slight_smile: ++
Tricotou

@tricotou Thank you for helping!
what about the constrain? Why does the cube’s location changes after making the clamp constrain?
and why can’t I move the cube when I want to animate it?

In my example I didn’t add any constraint, I selected Cube and Curve, CTRL P, Follow Path

@tricotou
The problem with “follow path” is that if I turn off the animation in the middle of the movement the object gets off course. I want that even if I turn off the animation the object will continue to move along the path with his speed this is the reason why I thought to use clamp to path.
Any ideas?