New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullReferenceException #2
Comments
…e prefab celestial body's game object as the parent of the prefab PQS controller's game object. The live CelestialBodyTransform is now referencing the live CelestialBody. However, a NullReferenceException still occurs in PQS.ResetSphere(). See Issue #2 on github.
Merge branch 'master' of https://github.com/BryceSchroeder/Kopernicus Conflicts: Kopernicus/KopernicusSystemSource.cs
I think this is caused by some subtle difference between GameObjects that are a prefab and GameObjects that are created at runtime. This occurs whether we create the PQS from scratch or clone it from the existing prefab of another world. I think the answer to this problem will be how do you create a prefab at runtime? The PrefabUtility class is in the UnityEditor namespace, which isn't available at runtime. |
Well, we could start by pursing in greater depth the ways in which a prefab On 29 July 2014 17:22, Nathaniel Lewis notifications@github.com wrote:
|
I'm fairly certain the reason that it effects the whole universe is because of the NullException - anything that would happen during that event after the PQS.ResetSphere call won't execute, because of the exception. |
Caused by created PQS prefab getting deleted by garbage collection. Solved by marking our prefab as don't destroy with UnityEngine.Object.DontDestroyOnLoad() See commit |
NullReferenceException
at (wrapper managed-to-native) UnityEngine.MonoBehaviour:StopCoroutine (string)
at PQS.ResetSphere () [0x00000] in :0
at PSystemSetup.SetPQSInactive () [0x00000] in :0
at PSystemSetup.SetMainMenu () [0x00000] in :0
at PSystemSetup.OnLevelWasLoaded (Int32 level) [0x00000] in :0
Currently the only exception occurring, right up until a ship is launched. Then the whole PQS system dies for all planets, and the game dies in a fit of exceptions from almost every component of the game.
The text was updated successfully, but these errors were encountered: