I need help displaying what Level count my player is on

Updated on January 16, 2019 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on January 16, 2019

I’m trying to display in text what the current level the player is on in my game. I appreciate any help. See my code below. 

Thanks,

 
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine;
 
public class LevelNumber : MonoBehaviour {
 
public Text Leveltext;
 // Update is called once per frame
 void Update ()
 {
 Leveltext = GameObject.Find("Level").GetComponent();
 
Leveltext.text = "LEVEL" + 1;
 }
}
 

  • Liked by
Reply
1 on January 16, 2019

Are each of your levels different scenes?

on January 16, 2019

Yes

Show more replies
  • Liked by
Reply
Cancel