Trigger gravity by external collider

I’m using the following script to enable gravity when I walk into a certain gameobject with my player (CardboardMain). With this script gravity is enabled when I walk into the object itself, but I want gravity to be triggered by an external collider. How do I do this?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TriggerGravity : MonoBehaviour
{

// Use this for initialization
void OnTriggerEnter(Collider other)
{
    if (other.tag == "CardboardMain")
    {
        GetComponent<Rigidbody>().useGravity = true;
        GetComponent<Rigidbody>().isKinematic = false;
    }
}

}

Add a field and assign the rigidbody that should get gravity

[SerializeField] new Rigidbody rigidbody;

void OnTriggerEnter(Collider other)
 {
     if (other.tag == "CardboardMain")
     {
         rigidbody.useGravity = true;
         rigidbody.isKinematic = false;
     }
 }

It still doesn’t work. I attached the script to a collider and I selected IsTrigger. I attached a mesh with a RigidBody to the script, but when I walk into the collider, the RigidBody doesn’t enables gravity. Anyone any idea why it doesn’t work?