Unityで、値を返した後にそのコンポーネントがついているGameObjectをDestroyしたいのですが
cs
1public int hoge() { 2 return 1; 3 Destroy(this.gameobject); //Destroyが呼ばれない 4} 5 6public int Piyo() { 7 Destroy(this.gameobject); 8 return 1; //動くが例外が飛ぶ 9}
という問題で困っています。
例外の内容は
MissingReferenceException: The object of type 'Class Name' has been destroyed but you are still trying to access it.
よろしくお願いします
回答3件
あなたの回答
tips
プレビュー