ZhbanyFatty Posted August 4, 2023 Posted August 4, 2023 (edited) Hi, after refactoring my project, i see the following error on startup (pic. 1). I could not find the cause of this error in the project, then I decided to build a new project, and after a few I was able to run the project without this error, but I did not find the reason for this. My project in editor (see pic. 2-4). Code lines where error is happened (pic.5-6). Plz, help me. pic. 1 pic.2 pic. 3 pic. 4 pic. 5 pic. 6 Edited August 4, 2023 by ZbaniFatty
silent Posted August 4, 2023 Posted August 4, 2023 Looks like you are trying to access an object without instantiating it. Please check similar questions of StackOverflow: https://stackoverflow.com/questions/779091/what-does-object-reference-not-set-to-an-instance-of-an-object-mean https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it Try to place some breakpoints in debug mode and see which exactly objects is null. 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
ZhbanyFatty Posted August 4, 2023 Author Posted August 4, 2023 I found out that the class WidgetsBuilder (Component on node Gui) is initialized after Class ProjectMain (Component on node Project) and ProjectMain try get access to methods from WidgetsBuilder, but is null. How i can change order of components initialization? (As i know, in Unity GameObject'components initialized from down to up (in the object hierarchy), but can't undestand how it works in Unigine).
sweetluna Posted August 4, 2023 Posted August 4, 2023 Components are initialized in order from top to bottom You might want to flip components on your nodes, so they initialize in the correct order. 1 May RenderDoc/Nsight Graphics/Intel GPA bless you
ZhbanyFatty Posted August 5, 2023 Author Posted August 5, 2023 Got it thanks. Also found in Component class, what i can set order of initialization by component's methods [Method(Order=X)] 1
Recommended Posts