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 /
This question was closed Oct 23, 2014 at 04:27 PM by robertbu for the following reason:

Other

avatar image
-1
Question by Benjeta · Oct 23, 2014 at 03:19 PM · scoreleveldisplaycount

How to script and display score

Hi everybody, I'm learning scripting and in my game I need a specific script.

I'm making a game that mashup 3D and 2D scenes.

Ok so, I need a script doing this :

When the player enter a object collider (object tag = Bonus) add 500 points to the total score and destroy the object.

if the object tag is (object tag = Small Bonus), add only 250 points and destroy the object.

If the player die so, restart the level but reset the score to the first time the player entered the level.

Exemple : If the player finish the level 1 with 500 points, start the level 2 with always 500 points obviously, and if he die after picking up some points, restart the level with 500 points. If the player finish the level 1 with 500 points and finish the level 2 with 1000 points, so, start the level 3 with 1500 points. If he die, restart the level with 1500 points... and so on ^^

The score need to be at the top middle and never being destroyed. So if the player change scenes, the score will be always there. That's it.

I need this in JS please, I can learn more easily in JS !

P;S : I'm french, sorry for my bad english.

Comment
Add comment · Show 4
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 robertbu · Oct 23, 2014 at 04:28 PM 0
Share

Unity Answers does not write or find scripts to specification. Unity Answers addresses single specific technical questions to help you write your own code.

avatar image Benjeta · Oct 23, 2014 at 04:32 PM 0
Share

I know, but I need help to at least understand how to do this.

I'm looking for help to write my own code. I'm really new to scipting. I'm making the music, the 3D, the 2D Sprites and all the stuff, I only need a little help to be able to script scoring. $$anonymous$$y knowledge in scripting are really weak. I only know some basics atm. But I learn really quick and all my scripts are done by myself. And i'm proud of me. I've even accomplished an IA. But like it's my first time using fixed parameter at load level or even, using GUIText ... I don't know how to proceed !

avatar image Kiwasi · Oct 23, 2014 at 06:15 PM 1
Share

Try the learn section. The tutorial on persistent data might be relevant. You also want to look up triggers.

avatar image Benjeta · Oct 23, 2014 at 06:20 PM 0
Share

Thank you ! :D Didn't know the persistent data ! It's ok for triggers.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

28 People are following this question.

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

Related Questions

OnTriggerEnter to load new level 1 Answer

calculate playerprefs and display 1 Answer

Score and Level Loading 1 Answer

how to count points for a water bottle flip game 0 Answers

How to increase score on hit 0 Answers


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