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 chucky831 · Dec 20, 2012 at 05:39 PM · guiscenescore

Final score in new scene

Hi, I have a stupid problem with the score. When I end a level I have to leave the screen a summary of the score. So to communicate between the two scripts I have been following these tips:

Script A: var scoreManager : Score; function Update () {

scoreManager.totalScore();

}

Script Score:

function totalScore(){

punteggio +=1; }

The problem is that it gives me an error saying ""

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 chucky831 · Dec 20, 2012 at 05:43 PM 0
Share

sorry, I forgot to write a piece. The error which gives me is the following: "Assets/Script/SCHER$$anonymous$$ATA1.js(11,14): BCE0019: 'totalScore' is not a member of 'UnityEngine.Score'. "

avatar image originalNarf · Dec 21, 2012 at 12:24 AM 0
Share

Click "more" then "Edit" to put that in the post rather than the comments.

avatar image originalNarf · Dec 21, 2012 at 12:27 AM 0
Share

Can you put up the relevant lines from SCHER$$anonymous$$ATA1.js?

avatar image chucky831 · Dec 21, 2012 at 10:09 AM 0
Share

there is code of SCHER$$anonymous$$ATA1.js

pragma strict function Start () {

}

function Update () {

}

function OnGUI () { GUI.Label (Rect (Screen.width/2-50, Screen.height/2-25, 100, 50), "FINE LIVELLO 1");

if (GUI.Button(Rect(10,10,80,50),"Livello 2")){

//CODE }

GetComponent(Score).punteggio; }

And there is code of Score.js

ar punteggio : int = 0;

function Start(){

}

function update(){

}

function OnGUI(){

GUI.Label (Rect (10, 10, 100, 20), "Score: " + punteggio); //disegno label su schermo

}

function aggiorna(){

punteggio += 1;

}

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by chucky831 · Dec 21, 2012 at 10:08 AM

there is code of SCHERMATA1.js

pragma strict

function Start () {

}

function Update () {

}

function OnGUI () { GUI.Label (Rect (Screen.width/2-50, Screen.height/2-25, 100, 50), "FINE LIVELLO 1");

  if (GUI.Button(Rect(10,10,80,50),"Livello 2")){
  
  //CODE
  }
   
  GetComponent(Score).punteggio;
 
 
    

}

And there is code of Score.js

ar punteggio : int = 0;

function Start(){

}

function update(){

}

function OnGUI(){

GUI.Label (Rect (10, 10, 100, 20), "Score: " + punteggio); //disegno label su schermo

}

function aggiorna(){

   punteggio += 1;   
    
   
   }
   
   
   
   
   
   
   



Comment
Add comment · Show 2 · 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 originalNarf · Dec 21, 2012 at 06:47 PM 0
Share

"$$anonymous$$ore", "Edit", then cut/paste all that code into the window that pops up when you hit the '101010' button at the top.

avatar image originalNarf · Dec 21, 2012 at 06:49 PM 0
Share

The error is on Line 11, Character 14 of SCHER$$anonymous$$A, which means it's in that //CODE bit. I need line 11 and it's context.

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

10 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

Related Questions

Loading a scene and keeping original score 3 Answers

How to create a point/score system based on player performance. 2 Answers

1st time to use Unity can help me with this simple project? 0 Answers

Script: import a 3d model to the scene from an outside folder 2 Answers

making and integrating Visual novel element in 3d game? 2 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