using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class Possible: MonoBehaviour

{

ย  ย  public string select;


ย  ย  public bool Gragas = true;

}


using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class gragas : MonoBehaviour

{

ย  ย  private Possible a;


ย  ย  void Awake()

ย  ย  {

ย  ย  ย  ย  a = GetComponent<Possible>();

ย  ย  }


ย  ย  public void change()

ย  ย  {

ย  ย  ย  ย  a.select = "Gragas";ย 

ย  ย  }

}



๋กค ๋ฐดํ”ฝ๊ตฌํ˜„์ค‘์ธ๋ฐ change ํ•จ์ˆ˜์— ์žˆ๋Š”ย select ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ €๊ธฐ์„œ ์ž๊พธ ์˜ค๋ฅ˜๋œธ


NullReferenceException: Object reference not set to an instance of an object


๋‚˜ ๋ฌด์Šจ ๋นก๋Œ€๊ฐ€๋ฆฌ์ง“ ํ–ˆ๊ธธ๋ ˆย ๋ชป๋ถˆ๋Ÿฌ ์˜ค๊ณ ์žˆ๋Š”๊ฑฐ๋ƒ? ์•„๋Š” ๋Šฅ๋ ฅ์ž ์žˆ์œผ๋ฉด ์ œ๋ฐœ ์™œ๊ทธ๋Ÿฐ์ง€ ์•Œ๋ ค์ค˜ ใ…œใ…œใ…œ