TWO PLAYER TOP DOWN - STOP PLAYERS RUNNING OFF SCREEN

I was kind of hoping for a better answer here. I’m having the same issue, except my camera also needs to zoom in and out. For some reason, this question is basically the only place online I’ve seen somebody try to get an answer for this.

Currently my fix is attaching four planes with Blocking collision to my camera, which sucks because it took forever to get their size/position/rotation right. And also I’m pretty sure they won’t work if your screen has a different aspect ratio than the computer I set them up in. Not ideal at all.

That anonymous guy with the vector math was onto something, but he just showed how to calculate whether or not the players are in-bounds, not how to actually keep them there.