The goal line doesn’t move, the offside line does.
Camera's are good enough these days to adapt to a player touching it last and a moving defensive line though.
Stick enough of them in the stadium and we should have some form of automated offside system.