Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Silicon Power on September 27, 2017, 08:19:03 PM
-
Hey guys, let say for example my game has an option to select between gamepad or keyboard controllers and everything is good except I can't save this options! so everytime I close game I must re-setup all options again because my global variable can't save its value. :'(
-
hi,
For this you can use playerprefs actions.
playerprefs is perfect for this, but not for saving scores/coins/etc... as it is very easy to hack.
It is ideal for preferences :)
so at the start of your game you need to use a 'has key' 1st to see if the key reference exists.
if not you can do a 'default' save.
then if it does exists the you can get the value with a playerprefs get action and if you change the value you need to use playerprefs set actions.
to reset (delete all saved data) you can use playerprefs Delete All
-
hi,
For this you can use playerprefs actions.
playerprefs is perfect for this, but not for saving scores/coins/etc... as it is very easy to hack.
It is ideal for preferences :)
so at the start of your game you need to use a 'has key' 1st to see if the key reference exists.
if not you can do a 'default' save.
then if it does exists the you can get the value with a playerprefs get action and if you change the value you need to use playerprefs set actions.
to reset (delete all saved data) you can use playerprefs Delete All
Thanks I'm going to test it soon, but can't we save a global variable value? I mean there is no way to do this? because I was planed to save all my character choices to global variables.
-
Ok playerprefs method works good for this section. But what if we going to create a big database of saved values?
-
Hi,
I would suggest getting the Easy Save (https://www.assetstore.unity3d.com/en/#!/content/768) asset