TWO PLAYER TOP DOWN - STOP PLAYERS RUNNING OFF SCREEN

You can just limit their position in world space. Meaning, when you update their movement you check if their global position is in the bounds you’ve set up and if not - do not update their position this tick.