save a int with playerprefs for one instance of a gameobject
Hey i have several pieces of a grid, call them tiles. These tiles all share the same script: Tile.cs These pieces are prefabs that are instantiated so they arent active in the scene until Start() In...
View ArticleHow do I use PlayerPrefs properly?
Hi, I'm trying to use my code as a countdown and race timer, which all works completely fine. But I am unsure of how to use PlayerPrefs.SetString properly so that I can output my race time to another...
View ArticleEditor PlayerPrefs getting repopulated with deleted values
I'm having an issue where I can't properly clear the PlayerPrefs under Mac OSX. I have delete the plist file located under `~/Library/Preferences/`, and the old values always comes back. [I've tried...
View ArticlePlayerPrefs and SharedPreferences in Android
There is a documentation error in the PlayerPrefs reference: http://docs.unity3d.com/ScriptReference/PlayerPrefs.html It says that playerprefs are stored in Android as [pkg-name].xml This was true...
View ArticlePlayerPrefs v. XML File for Saving Data?
Hello all, I searched all around Google and YouTube and I could not find a definite answer to my question. Should I use PlayerPrefs or XML files to save the all the data that is in Version 1 of my...
View ArticleHow do I get PlayerPrefs to save in WebGL build when hosted?
Hi! I'm using Unity 5.4.0b17, and I can't get PlayerPrefs to save when hosted. It works locally, but from my webserver, it doesn't. m_savedData.SetDefaults(); base64EncodedSettings =...
View ArticleHow do I save the high score from the game scene onto the main menu scene...
I've been watching tutorials and reading similar topics but to be honest, I'm not finding them very helpful. So far, I've successfully managed to use *Dontdestroyonload* and *PlayerPrefs* to display...
View ArticleSave a Toggle Group state?
Hi, Here is my current music mute code, which works perfectly. just what i need. but can't get the state of the toggle to stay as it should when resetting the scene. Thanks to anyone who can help!...
View ArticleSave a Toggle Group state?
Hi, Here is my current music mute code, which works perfectly, but can't get the state of the toggle to stay as it should when resetting the scene. Thanks to anyone who can help! using UnityEngine;...
View ArticlePlayerPrefs file wrong stored location
Hi! In the documentation I have read that with Android, the PlayerPrefs data is physically stored in /data/data/pkg-name/shared_prefs/pkg-name.xml. However in my case Unity is saving data in a file of...
View ArticleUsing multidisplay without windows main monitor
I have a set-up with three screens (left, middle, right) my left screen is and has to be my main monitor. I want to run an application on my middle and right monitor without having anything displayed...
View ArticleHow to stop objects you picked up from reappearing when you go to another...
I'm very new to Unity, but I would like to create a game in which you go to different scenes (levels) and collect lots of the same item, which is then used to open new stages of the hub world. The...
View ArticlePlayerPrefsException on Windows
I have a Unity3d game build on Windows width the 5.3.4 version. I get this error PlayerPrefsException: Could not store preference value at UnityEngine.PlayerPrefs.SetString (System.String key,...
View ArticlePersisting Audio Mixer Exposed Variables
I'm trying to read in my volume data persisted through Player Prefs into my Audio Mixer using set float in the Awake method, but it doesn't work. Any help on persisting AudioMixer volume. Need help...
View ArticleInstantiate and PlayerPrefs problem
Hi, I have a Enemy game object, to which I have attached a playerpref score manager script, which looks like this: using UnityEngine; using System.Collections; using UnityEngine.UI; public class...
View ArticleSaving and restoring playerprefs state
Hello! In our game we are using PlayerPrefs to handle game saving and loading. The game is however updated frequently, and we would like to ensure that the platerprefs data saved in all previous...
View ArticleChange store balanced based on level scores.
I have been trying to have the balance for an in game store based on scores from levels. I have code that gets the highscore from all the level and puts it in an array that is in a script on a...
View ArticleSwitch Modus using PlayerPrefs not working
Hi. I made this script to change the color of the sky and the ground when a button is clicked. This is the function that runs when I click the 'switch modus' button. using UnityEngine; using...
View ArticleHow to save and load player progress
Hi guys, i was wondering what is the best way to save a players progress. Now I've been able to save and load players position, but don't know how to go about stopping triggers from happening again as...
View ArticleHow to automatically generate a new int with a specific name?
Hello! I need to automatically generate an int with a specific name taken from PlayerPrefs. Here's the idea: //create the int void CreateInt() { new int PlayerPrefs.GetString("WhatToNameTheInt"); }...
View Article