Turn Off A Script During Collision

Hey, I’m really confused on how to disable a script of another object when the player is colliding with a game object. The script name is “FauxGravityAttractor” and the game object the player will be colliding with is named “victoryCube” Thanks in advance!

Something like this should work, though it’s not tested, so it might be a bit incorrect:

void OnCollisionEnter(Collision collision) {
    collision.gameObject.GetComponent<FauxGravityAttractor>.enabled = false;
}

https://unity3d.com/learn/tutorials/modules/beginner/physics/on-collision-enter