Forum rules - please read before posting.

Retain in prefab error

Hello everyone!
We have a trigger which autosaves at the end. After it autosaves, we are having a warning that says "Could not save GameObject Lombardi Sprite because "Retain in prefab?" is not checked". The funny thing is that we don't know where that option is. I've added the Constant ID and nothing.

Any clue?
Thanks a lot!

Comments

  • This warning will show for Remember components that are present on persistent GameObjects, i.e. those that are in the DontDestroyOnLoad section of the Hierarchy.

    The "Retain in prefab?" option can be found in the Constant ID component's Inspector.

  • Hello! Yes thought it was related to the Remember components, but the only Remember we have in our prefab is "Footsteps sounds" and can't be checked. Look:
    https://imgur.com/a/Cy1041A

    We don't have any other Remember nor constant ID in the character. I tried adding a constant ID to the Child and also can't be checked. I'm thinking the Remember components can ony be put on parents, hence, we need to move the remember footsteps. Is it something like that? Just want to make sure why we can't get rid of that warning and why we can't check the Remember.
    Thanks!

  • What's your AC version? Looks like there may be a related issue introduced in v1.75.4.

    Try opening up the ConstantIDEditor script and replace the block from line 48:

    else if (_retainInPrefab && _target.constantID == 0)
    {
        _target.SetNewID_Prefab ();
        _target.retainInPrefab = _retainInPrefab;
    }
    

    with:

    else if (_retainInPrefab && _target.constantID == 0)
    {
        _target.SetNewID_Prefab ();
        _target.retainInPrefab = _retainInPrefab;
    } else _target.retainInPrefab = _retainInPrefab;
    

    Does that resolve it?

  • Hello. To be completely honest, we put the Remember Footsteps in the parent, and there we could click on the "retain on prefab". That got rid of the warning.
    Our AC is always the latest.

    I don't think it's too much of a bug... I guess after trying things out we got it solved.

    To help you out:
    Yes, the code works. But what we did was just send it to the parent, though your code worked.
    Thanks Chris. I'm glad our team can be of help to you.

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.