so i have a game where i need gameobjects to bounce off the edge of the screen and detect when that bounce happens, right now i have some gray rectangles just outside of the camera and i detect when the circles bounce of of them but i have it set up so it has a fixed aspect ratio (16:9) and i'd like for it to be played in any screen size, how can i do that?
i asked chatgpt about it and it gave me a lot of answers but none worked, i serched it here but i didnt find it and i saw some youtube tutorials but none worked either
Put the following script on an empty gameobject
This script will automatically add an edge collider component and set it up at runtime so that it covers the edges of the screen. If you resize the screen resolution you should call the
UpdateScreenEdgefunction to update the edge points. Don't go too wild resizing, since your bouncing objects can easily glitch out of bounds.