For those who are experiencing the issue: “The name ‘Text’ does not exist in current context”,
try adding this line at the topmost part of the script:
“using UnityEngine.UI;”
Apparently, the ‘Text’ is using UI namespace so it is necessary to add this line.