This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
Followers 0
Particalister

Problem with UI.Text or Playerprefs

Question

Hello everyone , 

Basically let me introduce to my game...

 

Name : ColorCatcher (may be changed later...)

 

About the game  (Android , IOS):

 

Basic , All you have to do just touch on the colored balloons and it will be destroyed by the method ["Destroy(gameObject)"] and count + 1 & displaying on the UI.Text

I use playerprefs to count how much balloons I've destroyed

My problem is : The first balloon i touch on it , Counted and displayed on the UI Text , 2nd/3th/......100th is not counted but getting destroyed!

 

----

Scripts

 

Balloon Movements :

(Seems no errors on it..)

Please login or register to see this spoiler.

 

Okay. This is what I've setup  [Sorry There's no screenshot ] :

 

HideBall script is putted on "Score"

 

"Score" = UI.Text

= "0"

 

 

Based on the Hierarchy 

 

---------

the Balloons is not on the Hierarchy , it's on the folder called "Prefabs" in Project file.

---------

 

If this is not helpful , i can take screenshots/Video

----------

But please help me I've googled and it wasn't helpful for me 

Thanks for Reading

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0

Why do you want to save in PlayerPrefs integer your score? Use simply an integer - and save it only if it greater than the previous highscore.

Take a look at this script that I did quickly. However I use Physics2D, but you didn't tell us if you are creating a 2d or a 3d project ++

 

Please login or register to see this code.

  

 

Share this post


Link to post
Share on other sites
  • 0

So convert it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0