



It'd only take me about 10 minutes to implement, it's using off-the-shelf tools for 90% of the work, and it gives you a super easy way to actually see where your movement is restricted, because you can just attach renderers to the colliders. After thinking about it for a bit, this is almost certainly how I'd do it. This is probably the simplest approach, because Unity will just take care of everything else for you. Simply have a script on the camera which calculates the offset from the centre of the camera based on the size and aspect ratio. The colliders attached to the camera idea should work as well, though you'll need to ensure that their layers are set up so that only the players collide with them. If the camera is always at the midpoint of the two players, then when the camera is at its furthest you can just stop the players getting any further apart, which is as easy as modifying their movement vectors so that it doesn't increase the distance between them (i.e.: if they're moving away, clip their movement vectors so that only their sideways component relative to the other player is retained).
