Hi,
I'm using multiple cameras in one scene and I'm switching between the cameras as the game progress. I'm also using a custom action to switch to the previous scene with this, AC.KickStarter.sceneChanger.ChangeScene(AC.KickStarter.sceneChanger.previousSceneInfo, true);
Here's the problem, I would like to be able to switch back to a scene with the last used camera. However, every time I go back to the previous scene, the camera is not remembered even though I added a constant ID to all the cameras. Any ideas?
Comments
How many cameras are you talking about? You could store the "exiting" camera's Constant ID number in a Local Integer Variable and retrieve it again once the scene is entered again. It might be a bit cumbersome if you do it with AC's Actions, but if you're fine with custom Actions / scripting it should be quite simple:
To store the current camera ID in Local Variable 3:
int currentCameraID = AC.KickStarter.mainCamera.attachedCamera.GetComponent <ConstantID>().constantID;
AC.LocalVariables.SetIntegerValue (3, currentCameraID);
To then retrieve it and switch camera afterwards:
int currentCameraID = AC.LocalVariables.GetIntegerValue (3);
AC.GameCamera lastGameCamera = AC.Serializer.returnComponent <GameCamera> (currentCameraID);
AC.KickStarter.mainCamera.SetGameCamera (lastGameCamera);