Trigger Canvas With Collider in C#

Hello! So I’m trying to make it when you collide with my collide, my text canvas appears, but I cannot figure out how to do it in C#. I’ve tried a lot of different methods. If somebody could post me some code, that’d be great!

using UnityEngine;

public class ActivateTextCanvas : MonoBehaviour
{
	//This creates a field in the inspector that you can drag your text canvas into.
	public GameObject TextCanvas;

	//This makes the text canvas you dragged into the inspector appear when you enter the collider.
	void OnTriggerEnter(Collider other)
	{
		TextCanvas.SetActive(true);
	}
}