Camera logic to keep level and players within view
Posted: Mon Aug 01, 2016 10:38 am
I'm doing a platformer/beat em up like Smash Brothers, so I want the camera to stay on the characters while they move around.
I want the camera to follow the players and zoom out but have a limit relative to the level. I was thinking in my level editor id add a bounding box that says camera cant move further than these points and then maybe the same for a zoom out point.
I dont know if this the best approach.
Currently my camera code finds the middle point between all players and "Looks at" that point. When the distance between players reaches X the camera starts to pan out. The camera zooms in/out relative to the distance between players, but will eventually reach a max zoom and lock there.
I was wondering if anyone has any pointers/advice on this?
I want the camera to follow the players and zoom out but have a limit relative to the level. I was thinking in my level editor id add a bounding box that says camera cant move further than these points and then maybe the same for a zoom out point.
I dont know if this the best approach.
Currently my camera code finds the middle point between all players and "Looks at" that point. When the distance between players reaches X the camera starts to pan out. The camera zooms in/out relative to the distance between players, but will eventually reach a max zoom and lock there.
I was wondering if anyone has any pointers/advice on this?