Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by serkos · Oct 28, 2011 at 09:08 AM · score system

simple score system

im sorry for this question but i must to ask. cause i tried many times.

can someone help me ? about simple score system ?

there will be a ball. when the ball touched the box. the counter will count 3 seconds. then score +1000 and levelup,

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CHPedersen · Oct 28, 2011 at 09:15 AM 2
Share

You should try to write the code yourself first, then bring back the code that doesn't work when you encounter problems. If you don't know how to program, then search around for some Unity scripting tutorials and, optionally, some general program$$anonymous$$g tutorials. Occasionally, someone actually posts ready-to-use code for things like this, but they really shouldn't, because you won't learn anything from it. :)

For starters:

Study how to declare variables and set their values.

Next, study how to keep track of time in Unity. (The functions in Time, i.e. Time.deltaTime in particular)

Next, take a look at Triggers and Collisions (for when the ball touches).

When you understand the mechanics behind these three things, you should know enough to construct the score system you've described. The good thing is that your score system is well-designed for a beginning project because it is realistically simple, so you're more likely to accomplish it and not get frustrated. That's good. :)

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by syclamoth · Oct 28, 2011 at 09:17 AM

float score = 0; int level = 0;

IEnumerator WaitThenScore(flaot waitTime) { yield return new WaitForSeconds(waitTime); score += 1000; level++; }

void OnCollision(Collision collision) { if(however you determine that it is the box) { StartCoroutine(WaitThenScore(3)); } }

There you go.

Honestly, how hard can a scoring system be?

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CHPedersen · Oct 28, 2011 at 09:22 AM 3
Share

tsk tsk, Sycla. Now he's gonna do something like copy-paste that into a js-file, and come back with 50 compiler errors. Teach a man to fish, and...

avatar image syclamoth · Oct 28, 2011 at 09:28 AM 2
Share

Well, I could have written it in JS, but that'd just be making it too easy, wouldn't it.

avatar image LegionIsTaken · Oct 28, 2011 at 05:43 PM 1
Share

"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime."

Is that not how that goes?

avatar image
0

Answer by sergeimunov · Dec 05, 2011 at 10:51 PM

unity ANSWERS. someone ask someone answer..

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ishan0103 · Dec 25, 2015 at 01:03 AM

use a gui system dude sort of this way

static var score : int = 0;

function OnGUI () { GUI.Box (Rect (10, 50, 90, 40), ("score: " + score)); }

then use an OnTriggerEnter function to update this var called score how was my answer btw

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by SavaTim · Jun 13, 2019 at 02:05 PM

https://youtu.be/d547eh7jqaM

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why my score system not working? 1 Answer

Can add any value to survival score system 0 Answers

Score counter breaking after adding points 2 Answers

counting score after destroying game object 1 Answer

how to detect parent tag and not continually add numbers 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges