Help with c# code

Hi, I make a pong but i have one problem…
in Player vs pc mode i cant put a speed for pc player…
this is mi code, i put for the pc position the same of the ball but i want put a limit speed for the pc.
I put Rapit in 1 but dont do anithing… hes move in her velocity… help please

using UnityEngine;
using System.Collections;
public class Adversario : MonoBehaviour {
public Transform bola;
public float Rapit;
 
void Start () {
}
void FixeUpdate(){
}
 
void Update () {
 
 
Vector3 miPosicion = gameObject.transform.position;
miPosicion.y = bola.position.y;
gameObject.transform.position = miPosicion;
 
Vector3 velocity = gameObject.rigidbody2D.velocity;
velocity.y = Rapit;
gameObject.rigidbody2D.velocity = velocity;
}
}

you are setting BOTH the position AND the velocity of your object. This doesn’t make much sense.

I suggest you CHECK: to see if the ball is above the paddle gameobject.

if yes: set the velocity of your paddle game object to x=0,y=1

if no: set the velocity of your paddle game object to x=0,y=-1

Do not ALSO set the position of the paddle, just let the velocity move it into position.