How to make an object follow another object in one dimension.

I’m creating basically a glorified four-way pong game, so I have four paddles and any number of balls in play. I want the AI paddles to move left and right in their relative coordinates and not have to depend on the global space. I have this code so far to demonstrate what I mean, but it depends on the global coordinate system. I’m trying to get the left, right, and top paddles to work based on the same code.

    // If ball is within 70% of the middle of the paddle, decelerate
    if (Mathf.Abs(thisTransform.position.x - closestBall.position.x) < 0.7f * (thisTransform.localScale.x / 2)) {
        // Decelerate
    } else if (closestBall.position.x < thisTransform.position.x) {
        thisTransform.Translate(Vector3.right * Time.deltaTime * AIPaddleSpeed);
    } else {
        thisTransform.Translate(-Vector3.right * Time.deltaTime * AIPaddleSpeed);
    }

use Space.Self parameter to move in Local instead of Global

Well I know that. The problem is that the code I have checks distance based on a specific coordinate (in this case, x). I want that to be independent, I should have made that part more clear.