Original Discord Post by tyke_18 | 2024-11-02 15:30:25
Hi there
I’m looking into the LTM and learning about SpeakerID’s etc (the new feature to manage them is great), I’ve noticed in the ConvaiPlayerDataHandler script, when a new SpeakerID is created for a Playername, I think the OnDestroy() tries to write this data as a PlayerPref string with a call to SaveData(). However I found the code in SaveData() is not executed, when I quit my app (Meta Quest 3 app), meaning the PlayerPrefs aren’t saved meaning I keep recreating new SpeakerID’s as the script can’t find one that is saved. I put the call to SaveData() in an OnApplicationQuit() method and the code to save the PlayerPref string for SpeakerID and Playername is now executed, meaning the SpeakerID and Playername doesn’t keep being recreated as they now exist already for that Playername. I think so anyway! I assume I’ll need a speaker ID for each user of my app, meaning I’ll have to upgrade to Partnership when I have the funds. Sorry for the wall of text. I’m prepared to be told I’m completely wrong about all this lol!
Noticed there’s an error generated if the SpeakerID / Playername is deleted with the new Convai tool but the Player.Prefs variable for it isn’t. I bet I’m doing something wrong I totally expect that.
Reply by k3kalinix | 2024-11-02 22:45:17
Hello <@708608540763357234> ,
Thanks for the details.
I will inform my teammates.
Reply by tyke_18 | 2024-11-03 04:19:29
Hi K3 thanks I expect to be informed I’ve got something mixed up but as mentioned I wasn’t saving any SpeakerID’s / Playername’s as the code to save their PlayerPrefs values wasn’t being executed. It was when I put it in an OnApplicationQuit() it got saved. It might even be better to save the values immediately after they’ve been created as sometimes OnApplicationQuit() doesn’t run depending on how the user quits my app. Love what you’re doing at Convai you guys have a lot of fans.