Pants Poking Through Bottom of Shirt When Moving Legs Up

I’m having a problem changing the weight painting for the pants and shirt of my character. When my character raises his foot, I don’t want the top of the pants to poke through the bottom of the shirt. I already tried finding the right bones to change the weight paint influence and this helps in that it pokes through a little less, but the intersection still happens. I rigged the pants and shirt with automatic weights. I do know how to weight paint, but I already spent 2 hours trying this and can’t figure this out. Is automatic weights the best option for this area or is there a better/easier way to do this? Thanks in advance.

Nevermind I answered my own question. I found out that both the hip bones and the other leg bone were influencing the movement of the shirt on the leg I’m working on when they shouldn’t have been.