Needle : 3.45.2
Unity : 2022.3.12f1
Hi guys,
I have started occasionally getting the error shown in the screenshots and in the title. It happens as my game is loading. It causes my game to not properly load (In the screenshot you can see the entire view is weirdly skewed, and there is also no camera control and nothing progresses)
I have had the same scene setup for a long time now and this has only started happening recently. By default, I have a scene that has a particular gameobject disabled. I have a reference to it assigned via the inspector, and I enable it at a later time when its needed. However I do check the status of the gameObjects parent quite soon after the scene loads to see if it is disabled. I do it like this:
if (!GameObject.isActiveSelf(this.penaltyTaker?.gameObject.parent!)) {
//The parent will be disabled in Pre Game, and only needs to be enabled once
GameObject.setActive(this.penaltyTaker?.gameObject.parent!, true);
}
Is it possible that doing a check on an object that is disabled very early on as the scene loads could occasionally cause the issue? This call is triggered by receiving a message across a web socket which can happen very soon after the application is launched. It is there as a safety check to ensure it is disabled by default in our builds. That has been my setup for many weeks now, but its only lately this issue has started. I dont directly query a “visible” status on anything.
Im not actually 100% sure the above is what is causing the issue. That is the only thing I can think of in any way related to something being “visible” as per the error. While awaiting a response to this thread, I will look at potentially reworking it so only the mesh is disabled as opposed to the entire object, though I suspect I may run into the same type of issue.
As a side note, on a previous project I used to check something like this
this.freeCamera!.gameObject.activeSelf= false;
and then it stopped working, and I had to change to:
GameObject.setActive(this.mainCamera!.gameObject, false);
Do changes like this only happen on upgrade to later versions, or do you push changes to existing, older versions of Needle?