Forum rules - please read before posting.

Sub-scene layers

Hello,

In the game I have a main scene and I would like to add (and remove) other scenes as a sub-scenes (atop of main scene, but in smaller size). Right now I'm using Add Scene and it works well, but when the sub-scene is loaded all the layers between two scenes (main and sub-scene) are mixed. I understand that I could just shift up all the layers of sub-scene, but I believe there should be a more elegant approach...
And, when I use Add Scene, is there any way to change it's size?
The game is 2D

Thank you!

Comments

  • edited January 2019

    when the sub-scene is loaded all the layers between two scenes (main and sub-scene) are mixed. I understand that I could just shift up all the layers of sub-scene, but I believe there should be a more elegant approach...

    You're talking about sprite layers? AC isn't doing any fancy manipulation here - how things are displayed is all down to your use of Unity's SpriteRenderer and Camera components. Elegant or not, this isn't something AC controls.

    Shifting up the sub-scene layers would be the cleanest way, but I expect you could have a simple script in your sub-scene that does this for you automatically by e.g. finding all the SpriteRenderer components and increasing their Order value by a set amount.

    And, when I use Add Scene, is there any way to change it's size?

    The size of the scene? The scene file itself doesn't have a Transform. You can't modify the scale/position of the scene as a whole. All you can do is modify the scale of the objects within it. To change all with just one, you could parent them all to a shared "base" GameObject in the scene's Hierarchy.

  • Thank you Chris!
    To put all the scene's objects to a "Base" GameObject sounds like a good solution for resizing. To shift all the SpriteRenderer and Camera components with a script sounds like a good idea as well.
    Thank you again for all your help.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.