Quantcast
Channel: Questions in topic: "playerprefs"
Browsing all 1333 articles
Browse latest View live
↧

How can I save my game data

Hi, how can I save the gamedata of my shop. I am storing the score and other numerical value or strings in playerprefs but it came to know that player prefs can only store some limited values and I...

View Article


How to save the problem of this non static fields

I am trying to save the scene using this script but I had 3 errors when I called the methods from different scripts I fixed two of them by making them static but don't know how to fix the 3 one at line...

View Article


Why my playerPrefs doesen't work

im making a coin sistem, so when the player hits the coin it deletes and add a value to a UI, the problem is that when i stpo playing and play again the coin appears again. if someone could help me it...

View Article

Does OnDisable()/OnStart() get always called OnApplicationClose?

Hi, I want to Save all my PlayerPrefs when you change of scene but also when the game closes; I could put a `PlayerPrefs.Save()` inside this 3 methods to ensure they get saved but I'd like to increase...

View Article

How to check int value of PlayerPref

Hi all, I am very confused on how to check the value of a Playerpref. I have looked online at tutorials, but they only cover setting the player's position. I would like to write code that check if the...

View Article


How to make a script work in scene1 only if a collider in scene2 is triggered

So, I'm making this game that has a Level Select screen with few levels and then each of those levels has a scene. This is the LevelSelect scene: ![alt text][1] And this is the script attached to the...

View Article

PlayerPres work on my PC but not on my Android

Hi! :) I have a specific playerprefs variable that saves the amount of levels unlocked. notice that my code works perfectly on pc! but when I put the game on my phone it won't work. Note: The app is...

View Article

PlayerPrefs work on my PC but not on my Android

Hi! :) I have a playerprefs variable that saves the amount of levels unlocked.My code works perfectly on pc, but when I put the game on my xiaomi android it won't work. Note: The app is not requesting...

View Article


How can i get the value of the Scrpit what is attached on the Image

Hi guys, i usual try to solve my problems with lots of trying thinking and searching before i come here. I want the player to be able to just play one level after another. Following Problem: I have a...

View Article


PlayerPrefs with if statement not working

Hi, I'm quite new to unity and I can't figure out why this isn't working, I've use a very similar code elsewhere with no issues. I am trying to set the PlayerPrefs int only if the number is higher, for...

View Article

My game broke completely after adding player selection

Hi, I recently added player player selection in my game from which, when I click equip button the prefab it loads it's respective prefab in the main game scene. The problem is when It loads the prefab...

View Article

Why PlayerPrefs not working although I use "HasKey" and Save() on android?

I know others have written this problem before but even if I use haskey or save my android device does not save data. its work fine on pc btw. public class PlayerData : MonoBehaviour { public float...

View Article

Player Prefs Dosen't work on android

My player Prefs works on pc but dosen't work on Android, Help. Code here: using System.Collections; using System.Collections.Generic; using UnityEngine; using System; namespace BusinessTycoonSim {...

View Article


Value changes after using it in another script, why?

Hello I finally could solve my problem with playerpref, but now i have a new problem. I have the playerpref value and want to compare it with the value i put on every "LevelImage". But as soon i click...

View Article

How do i make a script that re-fills lives after 10min?

EDIT i got the life going down mechanics, i just need the time script. Everytime deaths go to 5 in a level i want to lower the PlayerPrefs for the Big Lives(ones in the menu, that decide wether you can...

View Article


Can i activate an action from a past scene in that scene without it being on...

I recently added energy for my game and tried adapting it so it suits it best. The energy script is in the Menu scene and i have something like this to trigger it : i am using 2 PlayerPrefs lets say A...

View Article

PlayerPref not save the fastest time

I am making a simple memory game where the fastest time is saved and appears in the main menu. But for some reason time is not saved. Bigger float is saved but smaller float not. using UnityEngine;...

View Article


PlayerPrefs for Random Materials

Okay, so below there will be a block of text, and I'm sorry, but hear me out: There's one scene which generates the "world" using a 2d array. Then, the next scene is the game itself, which is using...

View Article

How to make a Saved/Favorites system in unity?

I have no idea where to start with this or how to search for more info on this topic so i am coming here for advice. I want to make a Saved system where the player can press a Button and get the Object...

View Article

Resolution is not saving.

I am having a problem with the resolution. The resolution is not saved. When I close the game and reopen it at first it opens fine and suddenly it changes to a default resolution and I have to change...

View Article
Browsing all 1333 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>