How to parent a mask to another element in AfterFX? I have this video whereby text is revealed one letter after another. A text cursor is moving along with each letter to simulate the fact of writing the text on a word processor.

I have separate animations for the text being revealed: a mask expands, for the cursor: the position. Keyframes are aligned and the animation is linear.

However, the cursor is overlapping the text at the start of the animation as you can see here:



I also tried adding a solid layer that moves with the text and hiding everything to the right of the cursor. That works except when the background is not a solid color as is my case.

So my question is if I can parent the mask's movement to the cursor, or vice-versa? Alternatively, is there a better way to do it?
At the moment parenting a mask or its vertices to another object like a null is not possible by default. Although it is one of the most wanted features, probably there is no official solution for this. But in the same link you can find a link to a forum post where scripting master Dan Ebberts offers a solution. This solution has some limitations though, yet it might work in your project.

My solution would be more manual, this is not the fastest way but it works. If you are using a text layer, try adding an animator for the opacity, based on the characters.



Then animate your cursor layer's position accordingly. Or better, parent it to a null and animate your null and use hold keyframes.

This option is better than animating a mask on text layers, as it reveals each character. In your screenshot, there is this situation that your letters are revealed as if a linear wipe is used.