Ball reset in Pong

Recently I created 2D Pong but it’s still miss working reset ball function. I tried different ways of implementing it and none of them worked. Game is based on having Game Manager and until now i have 6 scripts: Player(player paddle), Computer(AI paddle), p(player) and c(computer) deadzones, ball and GM. How should I solve this problem? I’m working with C#.

You could create a ‘Launcher.cs’ class/object which is always active in the scene and controls when the ball is instantiated. When the ball needs to be reset just call a method from this class to create a new one. So, the class that handles the ball destruction event will then trigger the spawnBall method in Laucher.cs. You’ll need to reference it in that class

    public GameObject launcherObj;    
    public Launcher launcher;

    void Start()
    {
        launcher = launcherObj.gameObject.GetComponent<Launcher>();
    }

    void handleEvent()
    {
        launcher.spawnBall();
    }

Hope that helps!