Forum rules - please read before posting.

Camera Problem

Hello. There is a simple camera on the scene. Solid color is selected in the camera settings. But when I start the game, my settings are invalid and skybox automatically opens. This problem applies to all the cameras I use in the game. I don't know my problem with this AC. I think it's about ac. I did not encounter such a problem with projects without Adventure Creator.

Comments

  • edited August 2020

    I opened a new project and tried it. The same problem persists. This is not an issue for a project that is not Adventure creator.

    Photos:
    https://imgur.com/rFDooIt

    https://imgur.com/HBhWtTM

    https://imgur.com/m5AKP4O

  • edited August 2020

    When an AC scene is run, it is the MainCamera that performs the actual rendering - AC GameCameras such as the "SimpleCamera" in your Hierarchy are just used as a reference for the MainCamera's orientation and field-of-view settings.

    To change the background settings, just change the Clear Flags and Background fields on your MainCamera object - not the various SimpleCameras etc.

    The MainCamera won't copy these field values when switching GameCamera, but this can be added with the help of a simple custom script:

    using UnityEngine;
    using AC;
    
    public class CopyCameraClearFlags : MonoBehaviour
    {
    
        void OnEnable () { EventManager.OnSwitchCamera += OnSwitchCamera; }
        void OnDisable () { EventManager.OnSwitchCamera -= OnSwitchCamera; }
    
        void OnSwitchCamera (_Camera fromCamera, _Camera toCamera, float transitionTime)
        {
            KickStarter.CameraMain.clearFlags = toCamera.Camera.clearFlags;
            KickStarter.CameraMain.backgroundColor = toCamera.Camera.backgroundColor;
        }
    
    }
    
  • Thank you @ChrisIceBox . This works very well

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.