How can i activate a script on a character when entering in a trigger zone ?

Hello,

I’m new to programming so i’m having trouble with a script.
I can’t get my player activate a script that is on himself when he arrives in a trigger zone.
i just want that, when my player arrives in a trigger area, a script that is on my player activates and work when i’m on the area, and when i’m not on that particular area stop. The script is a script that activate a shader (the script with the shader is working when i’m just putting it on my player).

Thank you.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class trigger : MonoBehaviour
{
void OnTriggerEnter(Collision other)
{
     if (other.gameObject.tag == "Player")
     {
         Script Chunky = other.gameObject.GetComponent<Chunky>();
         Chunky.enabled = true;
     }
}
 
void OnTriggerExit(Collision other)
{
     if (other.gameObject.tag == "Player")
     {
         Script Chunky = other.gameObject.GetComponent<Chunky>();
         Chunky.enabled = false;
     }
}
}

Hi and welcome,
For scripts you don’t need “Script” in front, just write the actual script name.

Chunky.enabled = true

This is correct, however I need to see the starting of your “Chunky” script to see how you start your script.