Forum rules - please read before posting.

Camera: Shake option change the camera position after Save

edited April 2022 in Technical Q&A

Hello,

I have another question and I can't figure it out how to solve it.

So let's say one simple example. I have few AC Cameras. And let's say one camera is AC Camera X.
When the game start, the view can be seen in the MainCamera, even if I change the cameras with the Camera Switch. So good, so far.

But if I use the Camera: Shake option, when I am on** AC Camera X**, and after I save the game, when I come back with "Load", if I try again to use Camera: Shake (triggered by one hotspot), the MainCamera changes his position a little. If I do it again, it changes again and again until it is completely out of frame :(

The only solution I found was to use a Camera Switch (to AC Camera X) before the Shake Camera option.

The problem happens in the first room that appears after I Load to the game.
So is there any other solution to solve it, without use Switch Camera option before Shake Option?

How do I recognize the camera in which it is like an AC camera after Load?

Comments

  • edited April 2022

    What are your AC and Unity versions?

    In order for the camera state to be correctly saved, any GameCamera that may be active when saving the game needs to have a Constant ID component attached.

    This acts as an identifier in save-game data, so that the MainCamera knows which camera to attach itself to when loading a save-game file. See the Manual's "Saving scene objects" chapter for details on this.

    Does your "AC Camera X" have such a component attached?

    If you enable the AC Status box via the bottom of the Settings Manager, it will display the active camera in the top-left corner of the Game window - check that it still lists "AC Camera X" as the active camera both before saving, and after loading.

  • I have the latest version.
    I enabled the AC status box.

    Besides "Current game state: Normal"
    Before save, it says: Current camera: AC Camera X
    After save: Current camera: AC Camera X (same)

    But after load: just "Current game state: Normal", no info about current camera. (But I am still on the same place/camera/room, which is good)

    The only way to get my "Current camera: x..." back, is to switch to another ac camera, and then come back. And after, everything is normal.
    But if I will do again the save/load, I will be on the same Camera X, but Current Camera will not be set on that.

  • If the camera is not set after loading, it suggests that it has no "Constant ID" component. Check that it has one attached.

  • Oh yes. It seems none of my AC Cameras has a constant ID.
    So I should check it for each one.

    Thanks!

  • Back up your project first, but you should be able to automate this process via the "Auto-add save components to GameObjects" button in the Settings Manager.

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.