Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mooblegum on October 12, 2020, 11:42:45 AM

Title: Save different keys by levels to playerprefs [SOLVED]
Post by: mooblegum on October 12, 2020, 11:42:45 AM
Hello everyone,
I am struggling to understand how to save for each levels differents informations.
For example:
Like a mario game, on each levels there is 3 stars to collect, I would like to save the number of stars collected to player prefs so that on the level select screen I could show for each scenes how many stars the player has collected.
I know how to save to playerprefs but how could I save for each levels a different player prefs key? like level01Stars, level02Stars ....
Is there a way to automaticaly detect the scene name maybe?
Thank you!
Title: Re: Save different keys by levels to playerprefs
Post by: heavygunner on October 12, 2020, 01:53:42 PM
Try build string action and use the result as key
Title: Re: Save different keys by levels to playerprefs
Post by: mooblegum on October 12, 2020, 03:09:37 PM
Thank you Heavygunner!
I didn't know about this action, I guess I could then retrieve the current scene build number, and use it in the string to use as the key.
This seem clever!! Thank you so much  :D

PS: Just tested, work perfectly!!