Sorry if this is the wrong spot.... G'day everyone, I have something setup which loads from the resources folder(line 35 in LevelGenerator) currentLevel = Resources.Load<Texture2D>(GameManager.manager.currentLevel.ToString()); This works fine within unity, but when I build to PC (it is a mobile game, but that isn't building properly either, so I tried PC) I am getting the following error: NullReferenceException: A null value was found where an object instance was required. at LevelGenerator.GenerateLevel () [0x00001] in C:\My Games\BlockBash\Assets\Scripts\LevelGenerator.cs:35 at PlayLevel.Start () [0x0003a] in C:\My Games\BlockBash\Assets\Scripts\PlayLevel.cs:73 (Filename: C:/My Games/BlockBash/Assets/Scripts/LevelGenerator.cs Line: 35) In my build resources folder I have two files....is this correct?? unity_default_resources unity_builtin_extra Any information appreciated!
That doesn't seem to be a problem with resources. Since something is causing a NullReferenceException on that line, the problem is either GameManager, .manager or .currentLevel. Add logging to see which one of these is null. EDIT: Though of course if GameManager.manager is a static property, then you can skip checking whether GameManager is null and focus on the values returned by .manager and .currentLevel.
OK, will look into it, thanks Disregarding that though, are the files in the resources folder in a build, all compressed together? And if so, what is the name of that file? Thanks.