Prefabs not working on collision

The script below should make me teleport on collision (VelocityFixer() just changes velocity and is not related to the actual teleportation), and when I manually drag the prefab into the hierarchy and put that into the public gameobject I have at the top of the script for the 2 portals it will teleport me in between them, but if I just put the prefab inside the 2 public gameobject slots seen in the editor while on the player that contains the script and then I collide with either it will not teleport me. This is clearly bad because then teleportation doesn’t work.

void OrangeTeleport()
    {
        canTeleport = false;

        VelocityFixer();

        gameObject.transform.position = BluePortal.transform.position;
        //Thread.Sleep(1000);
        //canTeleport = true;
        timer = 1;
    }

    void BlueTeleport()
    {
        canTeleport = false;

        VelocityFixer();

        transform.position = OrangePortal.transform.position;
        //Thread.Sleep(1000);
        //canTeleport = true;
        timer = 1;
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject == OrangePortal && canTeleport == true)
        {
            //transform.position = new Vector3(Bx, By, Bz);
            OrangeTeleport();
        } 
        else if (other.gameObject == BluePortal && canTeleport == true)
        {
            //transform.position = new Vector3(Ox, Oy, Oz);
            BlueTeleport();
        }
    }

When you say “…if I just put the prefab inside the 2 public gameobject slots seen in the editor while on the player that contains the script…”, it makes me think you dragged the prefab from the project view into the reference in the Inspector. If that’s the case, then the prefab isn’t actually in the scene, and this code will not run.

To get the script into the scene, you will need to either Instantiate the whole prefab or add the component to an object with a collider on it.