Overlay characters (ignores positions) Any other different alternative to alpha over?

I have a character with special characteristics (toon shading) so I assigned it a different layer and based on a tutorial I applied alpha over but according to the position of the camera I overlap one layer over the other and I want it to maintain its positions. Do you suggest another alternative?

Thank you so much for your help


I found a solution to the problem, I changed alpha over by z combine and the layers I activated the depth pass, which I connected to node z