- Home /
Keep the multiple players within the screen
I want to keep all players within the screen like in Enter the Gungeon but unfortunately I can't achieve it. I use Centroid to find the center of the players and change the camera position to that point. Also I was trying to use Math.Clamp to set boundaries for players to stay inside camera view.
And now troubles start.
When one of the palyers approaches to this boundaries, it moves the camera and other players.
I have no idea what what to change to make it work.
Here's what it should look like: https://youtu.be/yNnwHZi4PHs
Answer by javiolvecal · May 05, 2020 at 01:39 PM
This tutorial can helps you
https://www.youtube.com/watch?v=aLpixrPvlB8
I've seen it, but this video doesn't show how to stop players from running away from the screen. It only shows the way to zoom in or out camera view. It's quite different than what I want to get.
Answer by javiolvecal · May 05, 2020 at 09:12 PM
Ah okay, I don't know how to do that, maybe you can make 4 boxes (with collider) and make them child of the camera, then put them in the camera borders. I'm not sure if it will work but you can try :/
Your answer
Follow this Question
Related Questions
What is the formula for ScreenToWorldPoint ? 1 Answer
Multiple Cars not working 1 Answer
Limiting vertical camera rotation 0 Answers
Change from 3D to 2D 1 Answer