How to unattach an object and reattach it somewhere else in an animation? I made this simple example u can see below to understand the problem. 

The little cube is attached to the bigger one with a child of constraint. I want the little cube to be able to move with the bigger cube, like in the gif below, and unnattach it when it reaches the top, and make it move to the cilinder from that point (I also would like to rotate, move, etc.. the little cube while it's going to the cilinder) and then attach it there to follow the cilinder. 

I have no idea how to do this and would be amazing if someone could help!
Go to the last frame where you want small-cube acting as the child of big-cube.  Keyframe loc/rot/scale and the influence of your child-of constraint (at 1.0).

Advance a single frame.  With small-cube selected, use &quot;apply visual transform&quot; operation.  (From ctrl-a menu in object mode for me.)  Small-cube will jump; don't worry about it.

Set the influence of your child-of constraint to 0 and you'll see small-cube jump back to where it &quot;should&quot; be.  Keyframe loc/rot/scale and constraint influence (at 0.0).

Optionally, turn off snapping in your graph editor and move this frame's keyframes -0.99 in the graph editor's X axis.  This is to preserve smoothness of motion.

Go to the frame when you want small-cube to begin acting as the child of cylinder.  Transform small-cube to how you want it to look at this frame.  Create an additional child-of constraint, targeting cylinder, and set the inverse.  Keyframe loc/rot/scale and constraint influence of this second child-of constraint (at 1.0).

Go back one frame.  Apply visual transform, then set constraint influence (of cylinder child-of) to 0.0, then keyframe loc/rot/scale and constraint influence.

Optionally, move this frame's keyframes +0.99 in graph editor's X axis.

Make and edit whatever breakdowns you want in the period between the small-cube acting as the child of big-cube and the child of cylinder.

Optionally, after completing the animation of small-cube and big-cube and cylinder and anything they depend upon, select small-cube and use a &quot;bake action&quot; operation with &quot;visual keying&quot; and &quot;clear constraints&quot; to write the constraints to raw transforms.  This will prevent any issues arising from motion blur and will allow you to retime the animation to your heart's content.