Pong Score Counter String wont work

Hi I’m a total beginner to unity. I’ve started my journey by trying what apparently is the simplest game, ‘pong’
Well…I’ve got stuck making the scoreboard counter.
The first time I ran it, it worked perfectly. I saved everything, then reloaded unity…and now I cant get it to work. What is really weird is that if I change my variable for my position where it registers the ball to be reset as slightly smaller than the position it reset then the counter works but in large increments (which I’d expect).
Any light shed on this would be beautiful

First of all use Code Sample to paste your code, not pictures.

Problem with your code is execution order. If Ball_Controllers update is ran first then ball will reset back to middle and Count_Score won’t do anything. If Count_Score is called first then it will most like work as you would expect.

I would remove whole Update method from Ball_Controller.cs and reset balls position in Count_Score.cs. I would also create method to update scoreboards text and call it only when score changes (no point of updating it on every frame of the game). You could also change variable ball type to Transform and at start ball = GameObject.Find(“Ball”).transform, then later you can just get ball.position.

void Update()
{
    if(ball.transform.position.x >= 20f)
    {
        Bat_1_Score++;
        ball.transform.postion = Vector3.zero();
        UpdateScore();
    }
    else if (ball.transform.position.x <= -20f)
    {
        Bat_2_Score++;
        ball.transform.postion = Vector3.zero();
        UpdateScore();
    }
}

void UpdateScore()
{
    Scoreboard.text = Bat_1_Score.ToString() + " - " + Bat_2_Score.ToString();
}