Forum rules - please read before posting.

Conversation dialogue option's "hasBeenChosen" appears to survive through multiple editor mode plays

I have a script to calculate how many options in a conversation the user has chosen already vs. the enabled options, so they can get a progress %. However it seems the variable I am caculating based off, hasBeenChosen, is remaining true after the editor has been stopped and restarted. I have Reload Domain and Scene on play.

I have tested triggering my calculation manually and in OnStartConversation. When I close unity then reopen, it seems to properly clear the info for the next playthrough.

Additional info: conversations are inside the scene. Start game via editor, trigger calculation by talking to NPC, logs in calculator reveal the option from the previous play are hasBeenChosen

Comments

  • Open up AC's ButtonDialog script and replace the line:

    public bool hasBeenChosen = false;
    

    with:

    [System.NonSerialized] public bool hasBeenChosen = false;
    

    Does that resolve it?

  • Yup! That appears to have done it!

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.