Question by
d-ostapa · Jan 08, 2020 at 08:41 PM ·
c#scripting probleminstantiatebuildbuild and run
Error with Instantiate after build
Hi, I was trying to add a 'fireball' attack to my wave game, and built the game after i got it working in the editor. When I ran the file I got a wierd error in my log file:
NullReferenceException
at (wrapper managed-to-native) UnityEngine.Object.Internal_InstantiateSingle_Injected(UnityEngine.Object,UnityEngine.Vector3&,UnityEngine.Quaternion&)
at UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) <0x1f249e69bb0 + 0x00062> in <3a69dc1755714a688e272fb29550dc99>:0
at UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) [0x00025] in C:\buildslave\unity\build\Runtime\Export\Scripting\UnityEngineObject.bindings.cs:202
at UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) [0x00009] in C:\buildslave\unity\build\Runtime\Export\Scripting\UnityEngineObject.bindings.cs:276
at Player.Update () [0x00207] in C:\Users\d.o22\Desktop\CS30 PROJECT DO\Assets\Scripts\Player Scripts\Player.cs:95
(Filename: C:/buildslave/unity/build/Runtime/Export/Scripting/UnityEngineObject.bindings.cs Line: 202)
Here is line 95 which it says has a problem:
GameObject FireballGO = Instantiate(FB, vfbsp, Quaternion.identity);
It works completely fine in the editor, but i get these errors only in build. I searched online and found about 2 others with a similar issue, but there were no answers to their problem. If you need more info to help let me know and ill try to provide. Thanks.
Comment