UnityEngine.Canvas' does not contain a definition for `FindWithTag'

I am trying to instantiate a text object stating the new score when and where an object dies. I can instantiate the object but I can not see it in the game view until it is parented to the canvas. That’s where the trouble begins.

private Canvas canvas;

	void Start()
	pos = transform.position ;
	Canvas thisCanvas = Canvas.FindWithTag("canvas");
	canvas = thisCanvas.GetComponent<Canvas>();

public void killBubble ()

	ScoreManager.score += scoreValue;
	Instantiate (scoreText, pos, Quaternion.identity);
	scoreText.transform.parent = canvas.transform;

how can i find the canvas to make it a parent of the instantiated text object?

thanks in advance for your help

There may be another way, but I always use:
(same function)

GameObject myCanvas = GameObject.FindWithTag("Canvas");

Should get the object tagged “Canvas” and set myTextGameObject as a child. You shoudn’t need to get the canvas component to parent it, since it’s always paired to a GameObject.