Question by
rosalie91 · May 29, 2017 at 02:24 PM ·
scorescore systemscoreboardscores
Problem with ScoreBoard in Ping Pong game
Hello Can you help me with my code for scoreboard in a simple PingPong game.
Thank you!
public Text Scoreboard;
public GameObject ball;
private int Bump1_Score = 0;
private int Bump2_Score = 0;
void Start () {
ball = GameObject.Find("Ball");
}
void Update() {
if (this.transform.position.x >= 14f)
{
Bump2_Score++;
}
if (this.transform.position.x <= -14f)
{
Bump1_Score++;
}
Scoreboard.text = Bump1_Score.ToString() + Bump2_Score.Tostring();
print(Bump1_Score + " , " + Bump2_Score);
}
}
Comment
Answer by Reals7eel · Jun 03, 2017 at 08:09 AM
you may have figured it out by now, but may you explain whats wrong with the scoreboard? your question is unclear. i'll try to help once i have an understanding of what you're trying to do.