Recording overlay not working

I’m just tried this but I had to take the 2, 3, and 4th lines out because I wanted her to come in the frame and it to pan and everything before the overlay was created, but it didn’t work. is there any way you could modify that to make it work without her coming in and the pan and everything after the overlay is created?