Forum rules - please read before posting.

Moving from a bootstrap scene to an AC scene changes the screen ratio

edited August 2021 in Technical Q&A

Hello,
As in the title, I have a project with currently two scenes: a bootstrap one - non AC - and a second one, built through AC. If I open the second scene directly, there is nothing wrong, it shows up at the expected 16:9 aspect ratio. But if I load the same scene starting from the bootstrap, the result is a squashed aspect ratio along the width. I can't even tell which aspect it is using, since in the inspector the fixed ratio I set before entering playmode doesn't change. And the weirder thing is, if I update that value in the settings, everything fixes itself.
I thought it could be because of some of my code changing a couple of fields in the menuManager and the settingsManager, but commentig out all that code nothing changes. Below the code I'm referring to and the comparison between what I'm expecting to see and what I get after loading the scene.

private void SetupSettings(AC.InputMethod inputMethod, bool useDirectMenuControl, AC.iSaveFileHandler saveHandler)
{
    AC.KickStarter.settingsManager.inputMethod = inputMethod;
    AC.KickStarter.menuManager.keyboardControlWhenDialogOptions = useDirectMenuControl;
    AC.KickStarter.menuManager.keyboardControlWhenPaused = useDirectMenuControl;

    if (saveHandler != null) AC.SaveSystem.SaveFileHandler = saveHandler;

    var inGame = AC.KickStarter.menuManager.GetMenuWithName(_inGameMenuName);
    inGame.appearType = useDirectMenuControl ? AC.AppearType.Manual : AC.AppearType.DuringGameplay;

    var inventory = AC.KickStarter.menuManager.GetMenuWithName(_inventoryMenuName);
    inventory.appearType = useDirectMenuControl ? AC.AppearType.OnInputKey : AC.AppearType.MouseOver;
    inventory.toggleKey = _inventoryInputAxis;
}

private void SetupSettings(AC.InputMethod inputMethod, bool useDirectMenuControl) => 
        SetupSettings(inputMethod, useDirectMenuControl, null);

private System.Collections.IEnumerator Start() 
{
        Debug.Log("Setting up for Mouse and Keyboard");
        SetupSettings(AC.InputMethod.MouseAndKeyboard, false);
        yield return null;
        if (_loadScene)
           UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(_sceneName);
}

Here's the expected result

And here's what I get after loading the scene

Comments

  • What are your AC/Unity versions, is this in builds or just the Editor, and what is your full set of "Camera settings" in the Settings Manager?

    The code shouldn't have an effect. Is anything else at play that may be contributing?

    The second screenshot shows a bar in the upper-middle. Is this remaining there like the borders?

  • AC version: 1.73.6
    Unity Version: 2020.3.16

    I opened the editor this morning to see the camera settings in the setting manager and retried and the issue automagically fixed itself.

    Still, if it can be of any help: It only happens on editor while builds are unaffected.
    The camera settings are set as 2.5D perspective, Fixed aspect ratio with a value of 1.777778 (aka 16:9), Render border camera true (but I also tried setting it to false and the isse remained). The rest is set to false.
    This project is just a test bench for some experimental code I've been working on and there is basically nothing else that could have any effect on the camera. The scene with Tin Pot only contains Tin Pot itself and a single hotspot (the barrels).
    The bar in the upper-middle did remain there like the borders.

  • Thanks for the update, let me know if this re-emerges.

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.