Hey, so I've set up a Battle Start Event to wait for the user to dismiss the tutorial message.

In the event, I check for a "Fight Tutorial Complete" PlayerPref. If it doesn't exist, I create it and set it to 0, then the logic waits for the user to click the mouse. If it does exist and is set to 1, the fight should kick off as per normal.

I'm then attempting to set the "Fight Tutorial Complete" PlayerPref int to 1 in a Battle End Event. The idea is that the next time the battle loads, it should see the PlayerPref set to 1 and not wait for user input.

Problem is I can't see the PlayerPref getting created in the registry. And the fight logic always waits for the user to dismiss the tutorial... Not sure what I'm doing wrong.

I have a few questions:

1.) When using Has PlayerPrefs, should I select Value with "Fight Tutorial Complete", or Player Prefs? Same question for Set Int PlayerPrefs
2.) Should the integer value type be set to Value?
3.) In Check Value I have a Player Prefs value type with key as "Fight Tutorial Complete". Is Int is checked. Check type is Is Equal, and Check Value's value type is Value with a value of 1.

Something is getting set somewhere because I can get the fight to either not start or not finish by messing with the PlayerPref Success/Failure wiring but I can't quite figure out how to get this to work properly...
  • 1) Set the Value Type to Value, since you want to define the key directly.
    Otherwise, e.g. using Game Variable, you'd use the value of a string variable as the key.
    This is the same for every PlayerPrefs key definition (or game variables) - if you define the name/key directly, use Value.

    2) Yes - same as with the key, if you want to define the value directly (e.g. 0, 1, etc.), use Value value type. Otherwise you can e.g. use the value from a game variable, a formula result, etc.

    3) Sounds correct.


    I'm not 100% sure if PlayerPrefs keys can have spaces in them - if your setup is correct (e.g. using Value value type for the key and value definitions), try using a key without spaces, e.g. "FightTutorialComplete".
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.