Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Why have error: NullReferenceException: Object reference not set to an instance of an object

$
0
0
public class GamePlayManager : MonoBehaviour { public void BirdDiedShowPanel(){ pausePanel.SetActive (true); scoreText.gameObject.SetActive (false); gameOverUI.gameObject.SetActive (true); resumeGameButton.onClick.RemoveAllListeners (); resumeGameButton.onClick.AddListener(()=>RestartGameButton()); } } public class BlueBirdScript : MonoBehaviour { void OnCollisionEnter2D(Collision2D target){ GamePlayManager t = new GamePlayManager(); if (target.gameObject.tag == "Ground" || target.gameObject.tag == "Pipe") { if (birdIsAlive) { birdIsAlive = false; anim.SetTrigger ("Died"); audioSource.PlayOneShot (diedClip); GamePlayManager.instance.BirdDiedShowPanel(); t.BirdDiedShowPanel (); } } } why t.BirdDiedShowPanel error (line 22) ???, I don't understand, please explain it

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>