Masking independently moving objects

I have groupA with several layers including ObjA. This group has its own transformations and moves.

Then I have groupB with other layers including a mask MaskB. GroupB also has its own transformations and moves independently of groupA.

In my animation I need at some time ObjA to start moving toward groupB and be partially masked by MaskB. From here on ObjA must move integral to groupB as if it belonged to it.

How can I achieve such an effect?

best regards

There are a few options.

I suppose maskB is not supposed to be seen, right? In this case:

  1. You can place a mask in another group (outside/nelow groupB) - name it as groupMaskB
  2. Make this new group the real mask (blend method as Alpha Over).
  3. Link transformation parameter of groupMaskB and groupB together
  4. Repeat previous step with origin parameter

This way both the groupB and groupMaskB move and transform together.