Forum rules - please read before posting.

Character missing on load

Hello. I have no problem running the scene but when I load a save into that scene my character is missing. I can see on the group DontDestroyOnLoad that my character is not there after loading. Do you have any idea what is wrong?

Comments

  • Welcome to the community, @MartinGo.

    Does the scene have a local Player object, i.e. a Player character within the scene file while in Edit mode? If so, this will override the spawned Player - assigned in the Settings Manager - for the duration of that scene.

    If not, the spawned Player should be present in the DontDestroyOnLoad group at all times - at what point do they get removed from this list? When loading the save file?

  • The scene doesn't have a local Player, it is taken from DontDestroyOnLoad when is missing on the scene it is missing from this group.
    The Player is missing after load a scene. I carefuly looked for something on my ActionList OnStart but I removed everything and I still have the problem. I suspect that could be on my save and load.

  • Thanks for the details. What are your AC and Unity versions?

    The spawned Player prefab should typically only be removed upon entering a scene with a local Player. If that's not the case, are you running any Actions or custom script when loading a save-file, and do you get any related messages in the Console at the time?

    See if this occurs with a fresh AC scene. Use the Scene Manager to set up AC in an otherwise empty scene, add it to the Build Settings, run it, and try saving/loading within - does it still occur.

  • edited January 2023

    My AC is v1.62.6 and Unity 2020.3.30f1

    are you running any Actions or custom script when loading a save-file, and do you get any related messages in the Console at the time?

    How do I check that? I don't get any message in the console just the File read notification with the location

    See if this occurs with a fresh AC scene. Use the Scene Manager to set up AC in an otherwise empty scene, add it to the Build Settings, run it, and try saving/loading within - does it still occur.

    I didn't try that yet but my guess is that it would work. And after reading that I am thinking that maybe a worth of try would be copy and paste of each object to another scene file, one recently created to discard the bad scene problem because a lot of versions has passed for this scene file

  • It's a very old AC version, to be sure. Are you not able to update? It would be worth testing the latest release in a backup/duplicate project.

    If you're loading save files from a SavesList menu element, you can assign an ActionList to run upon loading within the element's properties.

  • Well I create a new scene from scratch and the character doesn't disappear when I make a load :#

  • edited January 2023

    How does a new scene compare to an old one? Do old scenes have an OnLoad cutscene assigned? You're certain no local Player is present?

    If the Player gameobject is being deleted, a brute-force approach would be to search the code for instances of "Destroy" function calls, which is what's used to remove objects from the scene.

    Do you have any custom code that calls this function? As a last-resort, placing Debug.Log statements above each would allow the Console to report when and how such objects are being deleted.

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.