I am new to unity and I dont know why my obstacle 2 is not moving how it should be but my obstacle works just fine. I also have a move left script

{
public GameObject obstaclePrefab;
public GameObject obstacle2Prefab;
public GameObject heartPrefab;
public float startDelay = 1;
public float heartDelay = 4;
public float repeatRate = 2;
public float repeatHeart = 6;
private Vector3 spawnPos = new Vector3(36, 1, 0);
private Vector3 spawnPos2 = new Vector3(45, 3, 0);
private Vector3 spawnHeart = new Vector3(30, 2, 0);

// Start is called before the first frame update
void Start()
{
    InvokeRepeating("SpawnObstacle", startDelay, repeatRate);
    InvokeRepeating("SpawnObstacle2", startDelay, repeatRate);
    InvokeRepeating("SpawnHeart", heartDelay, repeatHeart);
}

// Update is called once per frame
void Update()
{
    
}

//Obstacle prefab 
void SpawnObstacle ()
{
    Instantiate(obstaclePrefab, spawnPos, obstaclePrefab.transform.rotation);
}

//obstacle prefab 2 
void SpawnObstacle2 ()
{
    Instantiate(obstacle2Prefab, spawnPos2, obstacle2Prefab.transform.rotation);
}

//heart prefab 
void SpawnHeart ()
{
    Instantiate(heartPrefab, spawnHeart, heartPrefab.transform.rotation);
} 

}