Forum rules - please read before posting.

Sky as Background in AC 2.5D mode

Hi, I am using USky, a beautiful sky system, but I like to display the clouds at the background of the 2d image that is rendered by the AC 2.5D camera. But how do I do this? I tried a lot of things with the culling masks an the depth and clear flags but I can't seem to find a proper solution to make 3 cameras that render 3 different layers in the scene. Probably this has to do with how the 2.5D cam of AC handles the layers. So I hope someone could help..


  • The backgrounds displayed using AC's 2.5D camera aren't rendered in 3D/physical space, but instead using a GUITexture.  It's convenient when working with multiple 2.5D cameras, but probably won't play too well with a sky system like that.

    You may instead have to switch to a regular GameCamera that's fixed in place, and manually place down your background as a plane / sprite in 3D space.  You'd only have to do this for any camera you want the sky to work with, and you can drag in the GameCamera prefab manually from /Assets/AdventureCreator/Prefabs/Camera.
  • Thanks Chris, that is a possibility, but with it, other problems arise, such as: I want to cast shadows on my navmesh but the navmesh is visible now. Probably due to the fact I dont use the 2.5D camera anymore.
  • edited May 2016
    The main problem is that the GameCamera is switched off on start, but that is exactly the camera I need to show the shadow with Clear flags set to Depth only. The MainCamera doesnt render the NavMesh, only the GameCamera does, with the Matte_Shadow material.
  • The MainCamera's clear flags are automatically set to Depth when attached to a 2.5D camera, but you'll have to set this manually through script otherwise.  The MainCamera function that does this is public, and named PrepareForBackground.  You would be able to call it with a custom script using:

    AC.KickStarter.mainCamera.PrepareForBackground ();
  • Thanks Chris, but I actually meant the GameCamera and not the MainCamera. The GameCamera seems to be disabled at start. I just wrote a script that enables the cam and that also worked. So problem solved it seems. I just doubt this is the right way..
  • So, the problem is that the MainCamera needs to switch the other camera's, keeping there enabled state to show the shadows (and/or other layer(s)) or disable it when switching to another GameCamera. But now I think of it, that might be what you meant. So I need to manually write a script for the MainCamera that enables the gamecamera's? (The AC 2.5D Camera does switch to the right camera but the problem is the Camera itself is actually switched off so it can't cast shadows or put object on another layer in this setup) 
  • The MainCamera should always be the only one that's ever active - AC's camera system works by having the MainCamera copy data from the "active" GameCamera (which isn't actually active, it's just used as a reference).  So yes: you'll want your script to change properties of the MainCamera, not the GameCamera.  If you place this code in a custom Action, you can run it after switching to a new camera.
  • Maybe this wasn't a clear question. So my question is: How can I switch my GameCamera's on and off, like it used to be with the 2.5D Camera, with the difference they are really on (not just enabled) or really off? (I mean the 2.5D camera's are always on but not really on, the check box of the camera is always unchecked but I need to get it checked and unchecked depending on which gamecamera)
  • You could enable them, but you'd have to disable the MainCamera so that they then become the MainCamera.  This might well cause problems, though, which was what I was trying to get at.  Why are you not able to simply amend the MainCamera instead?
  • edited May 2016
    You mean to only use the MainCamera? But how should I handle the layers then? If the layers are always on, you will see all layers on top of eachother, or am I wrong? So I need to use the different camera's to switch the particular layers on and off. Or I could just make the layers visible to the MainCamera except for the sky that is done by another camera. Something like that?

    EDIT: Sorry, I didn't see your previous comment, I think I understand now. I will try it and report the results. Thanks a lot again!
  • edited May 2016
    I came to a solution that is far easier and works perfect: make an extra camera, set clear flags to Depth only, put a script that follows the positon of the gamecamera and shadows are always there without any extra complicated layers or what so ever. :) 
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.