The expression above didn’t work for me the one I got from Reddit worked. I pasted the expression below and the link to the post in case the formatting is messed up when I pasted
// get size of layer. Returns obj with { left, top, width, height }
var b = sourceRectAtTime(time,true);
// correct for scaled layers.
b.left *= scale[0]/100;
b.top *= scale[1]/100;
b.width *= scale[0]/100;
b.height *= scale[1]/100;
// stick anchor at horizontal center, vertical bottom.
[b.left + b.width/2 , b.top + b.height]
// You could also use this to lock at bottom left:
// [b.left , b.top + b.height]
https://www.reddit.com/r/AfterEffects/comments/d6k4zz/have_text_build_from_the_bottom_up/