Forum rules - please read before posting.

Switching Scenes - Camera Overlay Issue

I'm working on a 2D point and click game and so in each scene are several "screens" with a camera assigned to each "screen". You move between the "screens" by switching the camera. There are several scenes in our project and I just started to work on switching between scenes. However, when I create an interaction using Adventure Creator's scene switch, assign it to a hotspot, and then test it out, for some reason while the new scene is loading it doesn't use the current "screen", the one with the scene switch hotspot I just clicked on, to overlay the switch, it uses the previous "screen." Ex. If I walked up to a door and click to go through it (to a new scene) it overlays the camera with the scene that is backed up from the door (the one before getting to the door). It doesn't matter if I have the overlay option selected or not on the switch interaction. What am I doing wrong?

The scene switch does complete successfully. Thank you!

Comments

  • Welcome to the community, @redm33.

    Sounds odd - what are your AC and Unity versions, and are you relying on "Asynchronous loading" via the Settings Manager?

    As this is a visual issue, can you share some screenshots to help illustrate the problem? How are these "screens" separated in the scene? Seeing the whole scene via the Scene window will help understand the layout.

    Try pausing the game while this issue occurs, and view the MainCamera's Inspector. It should list its "Attached camera" at the bottom. Is it showing your suspected "previous" screen camera, or is it that the correct camera is somehow in the wrong place?

  • edited April 2020

    Unity Version is 2018.3.0 and AC version is 1.70.1.

    We do not currently have the Asynchronous loading selected.

    I'm unable to pause the game during the switch because it's in the process of switching scenes at that point... However, if I just watch the Main Camera, it never changes the attached camera.

    Each of the images in this screenshot has a camera assigned to them and hotspots to "move around" basically just switch the camera to the correct graphic.
    https://imgur.com/2G2HHf1

  • What of the MainCamera's position, and are your GameCameras using Perspective or Orthographic projection?

    If the camera is going back to the previous camera, we can see if its being commanded to. Open up the MainCamera.cs script, and find the function "SetGameCamera" (it'll be around line 660).

    Just inside it (i.e. below the open bracket "{"), insert the following:

    Debug.Log ("Set game camera to: " + newCamera, newCamera);
    

    That should print a log into the Console whenever the camera is changed. Is this shown when the issue occurs? If so, what is the message in full? (There'll be more beneath it when you select it).

  • The MainCamera's position is the same as whatever graphic I'm on. We are using Orthographic projection. As far as I can tell, the transform component on the MainCamera does not change at all when the issue occurs.

    The debug line you sent shows when I'm transitioning between graphics in the same scene but when I go to switch scenes (when the issue occurs) it does NOT print to the log.

  • Can't tell why this would be happening, then. You're not running any other ActionLists / scripts at the time of the scene-change, other than the one to handle the change itself?

    Best for me to see this for myself. If you can create a .unitypackage file of the scene, it's graphics, your game's Managers, and any relevant ActionList asset files, PM it to me and I'll see if I can learn what's going on.

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.