How to make the ball bounce and act like the ball of the paddle game?

    if (playerController.ShootBall==true)
    {
        // Calculate the impact point relative to the paddle's center (-1 at bottom, 1 at top)
        float hitPoint = (transform.position.y - collider.transform.position.y) / collider.bounds.size.y;

        Vector3 newDirection = new Vector3(Mathf.Sign(ballRb.linearVelocity.x) * -1, hitPoint).normalized;
        acceleration++;
        ballRb.linearVelocity = ballRb.linearVelocity.normalized * (initialSpeed * acceleration);
      
    }

This script is located in the ball script. When I press space bar, I make an instantiate and call this ball. What I want it to fly in the direction as illustrated in the picture below:

My problem is that the ball goes straight line and moves right or left when the player moves the paddle right, left as it is flying straight. However, I placed this code in another game object and placed that game object in the prefabs folder and I called this ball in the SpawnManager prefab global variable. So it should be a separate identity. Any advise?

thanks in advance.