Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Diplay player final score in new scene in unity

public class PlayerScore : MonoBehaviour 
{

    public Transform player;
    public Text scoreText; 

    // Update is called once per frame
    void Update() 
    {
        scoreText.text = player.position.y.ToString("0"); 
        PlayerPrefs.SetInt("CurrentScore", player.position.y);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Diplay #player #final #score #scene #unity
ADD COMMENT
Topic
Name
2+9 =