You are about to write a code to keep score. There are several controls, so we split the code. In the event of a collision
scoreSum man = GameObject.Find("scoreManager").GetComponent <scoreSum>();
man.score ++;
I used to increase the score, and in the code scoreSum, I defined the text Sc and
void Start()
{
score = 0;
}
void Update ()
{
Sc.text = score.ToString();
}
This is how you continue to display your scores. However, the score is not initialized, and even if the score does not go up during the game, the score will not be displayed at once until the game is over and back to the game window. How should I fix it?
unity
Is it correct that the text called Sc is well connected to the GameObject?
Isn't Text not connected well to Sc like the attached image?
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
614 GDB gets version error when attempting to debug with the Presense SDK (IDE)
922 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
576 Who developed the "avformat-59.dll" that comes with FFmpeg?
623 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.