プレイヤーにポーズ機能を付けたのですが、うまくいきません。
まだ勉強中で分からないことも多く、こちらのサイトhttp://ftvoid.com/blog/post/660を丸写しで使用していますが、シーンを跨ぐと下記のエラーが発生します。
分からないなりに思い付いたものは全て試して見たのですが、結局分からず仕舞いでこちらに相談にきました。
pauseGの変数で参照しているオブジェクトを無いのに使用しようとしているということで良いのでしょうか…?
どう直せばいいのかまで教えてくださると嬉しいです。
MissingReferenceException: The object of type 'pauseG' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponentsInChildren[Behaviour] (Boolean includeInactive) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/ComponentBindings.gen.cs:99)
UnityEngine.Component.GetComponentsInChildren[Behaviour] () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/ComponentBindings.gen.cs:109)
pauseG.OnPause () (at Assets/Scripts/pauseG.cs:39)
pauseG.Pause () (at Assets/Scripts/pauseG.cs:68)
talkTestScript.talkOpen () (at Assets/Scripts/talkTestScript.cs:185)
talkTestScript.action () (at Assets/Scripts/talkTestScript.cs:223)
talkTestScript.OnCollisionStay (UnityEngine.Collision col) (at Assets/Scripts/talkTestScript.cs:139)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/07 13:23