- Home /
Help with score
I need some help I can't figure out what's wrong. I want to if you're game over that the score goes into the other script. so you can see what score you have. this is what I don't know how to fix: GUI.Label(Rect(280,70,250,30), "Your Score:"+ counter); }
The score script:
function OnGUI(){
gameObject.Find("Main Camera").SendMessage("Counter");
GUI.Box(Rect(210,20,400,420), "Game Over");
GUI.Label(Rect(280,70,250,30), "Your Score:"+ counter); }
And here's the other script:
var counter : int = 0; var scoreText : GUIText;
function Update(){
scoreText.text = "Score: "+counter; function Counter(){
counter = counter;
}
function ScoreUp (){
counter+=1;
}
Describe what you are trying to accomplish, and what isn't happening the way you expect.
Format your code using the tools provided in the question editor.
Describe what you have done to solve the problem yourself.
Do these things, and you will have much better luck getting someone to help you.
Answer by Dave-Carlile · Dec 20, 2012 at 03:32 PM
UnityGems has a good tutorial on script interaction that should be helpful.
http://unitygems.com/script-interaction-tutorial-getcomponent-unityscript/
Your answer
![](https://koobas.hobune.stream/wayback/20220613085618im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Score Keeper / Kill Counter Help 1 Answer
Scoring not working for pong 1 Answer
Cube terrain with perlin noise 1 Answer
Click To Revert to Original Texture else Destroy script help 1 Answer