- Home /
switching between different screen boxes
In this fantastic video tutorial (Video), at the end when the game is demoed, the character runs off the edge to the next section of the same level ( I say same level because you see particles being generated in the Unity UI and the dev has about 6 scenes, but changes "location" in the same scene 3 times. He makes the comment "we are switching between different screen boxes". What does that mean and anyone know how its done? I can change unity scenes but this does not appear to be that.
I have not heard of a screen box, but what you are explaining here seems to be a simple change in camera position.
So you think he had multiple places in the scene and just hopped the player and camera to the next "spot"?
Answer by highpockets · May 08, 2019 at 09:53 PM
A scene can be as big or small as you want it to be. I’m assuming a “screen box” is designed almost like a separate scene. It can be in a completely different position in the world from the first, second or third “screen boxes”. All you have to do is change the camera position and the character position and you can be there from one frame to the next. The benefit of doing things this way is that you don’t need to wait for a new scene to load as you switch to and from areas
To be honest, would really appreciate a tut video for screen boxes. Just a mere camera transition video, which will help us get a better understanding of screen boxes and its implementation.
@sukantpatra please post a comment when you are not answering a question. I converted your answer to a comment. I'm not so sure that "screen box" is a very well known name. I'm not 100% sure, but the author of this video may have just gave it a name that he felt was suitable for the concept. You can make the camera transition to anywhere you like and you can compartmentalize your scene into however many pieces you want or you can make a separate scene to separate the different areas.
For example if your player walks through a door from one room to another room in a house, the room on the other side of that door could be a separate scene that you load async when you get close to the door or you could have the room in the same scene as the rest of the house and you just change the camera position and orientation to expose the room within that same scene. The 2 rooms could be physically attached to the same mesh or they could be completely separate and in completely different places in 3D space.
Right, the different "level sections" (which would have been a better name) just are loaded / replaced when the player left the current section on one end. However the approach that was used in the video is actually a quite bad one. Doing a hard switch between two sections limits the level design as the player doesn't see what's com$$anonymous$$g next. Of course this is the simplest approach as the different sections do not have to line up / match perfectly at the edges since we just switch over.
One of the main points of splitting a larger level into sections / parts is performance and used memory. Though this is more important for mobile games than for PC / $$anonymous$$ac / linux standalone games. Splitting a level into seperate sections of course is more complicated than creating a single continuous level.
Answer by Slayerazazel · Jan 31, 2020 at 11:41 PM
The video shows you how to set up your screen boxes / screen frames. Camera set up and the script to transition between.
Your answer
Follow this Question
Related Questions
2d art - Help 1 Answer
How to create 2 panels on same scene and don`t overlay 0 Answers
Stoping character with Platformer Controller script attached. 2,5D ladder. 1 Answer
2D platformer- getting errors I don't understand (c#) 1 Answer
2d character controller for platformer with touch or mouse input? 2 Answers