There is a Movie script which serves to control the player and it contains the number of health. It is necessary to display the number of HP on the Canvas in the Text. I do this through the Game script.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Game : MonoBehaviour { public Text Zdor; public Text Level; public Text Point; public string mytext; // Update is called once per frame void Update() { Movie hp = gameObject.GetComponent("health") as Movie; Zdor = hp; } }