[SOLVED] How to eliminate script load delay?

I’m not sure if that’s the cause. But it seems as if there is some sort of delay in MonoBehaviour scripts.
For example, very often the Start() method simply is useless, because at that point Game Objects or other scripts simply dont exist yet. (Atleast that is what the scripting engine thinks, the object actually exists in the hierarchy)

In my current scenario I’m trying to giving a game object to a Public field as usual, but the script does not see it in the Start method.

It’s really frustrating because the whole scripting becomes unstable and useless at that point. Whats the point of a script, if it will never work the way it should? I’m tired of these mind games… Please Help!!!

Can you provide the actual code? Or go into a lot more detail? Per unity’s execution guide by the time its processing starts all objects should have been instantiated and ran their awake functions

Are you creating an object in one Start method and then trying to find it in another? This would depend on script execution order. The script doing the creating must execute before the script doing the finding. You can control the execution order in settings.

Thank you for your reply’s. I’m unsure how it exactly got broken, because it looked fine. I started the project and script from scratch and it works now.

I had some similar issues back in 3.5~ days. Someone mentioned that it was caused by faulty .meta files. Not sure how they get corrupt, but seems like it still can happen.

Thanks for the execution order link, useful information!