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);
}
}