Start() being called but not Update() on "imported" GameObjects

Basically I load assetbundles and compiled dlls at runtime. This works pretty well so far and I can instantiate prefabs and load them into my scene.

The components are there and I can read/write fields/properties like with any other gameobject. Even Start() is being called, however Update() is not.

It looks like the UnityEngine doesn’t have it registered somewhere it stores the list of Objects to Update().

Any ideas?

  • You misspelled Update() or otherwise have the wrong method signature. One common mistake is not capitalizing the “U”
  • Your GameObject is getting deactivated or the MonoBehaviour is getting disabled.
1 Like

Tried it with multiple scripts, also with the generated void Update() scripts, not a typo

The object is definitely active. Also checked with the debugger and it’s both activeself and inhierarchy.
Other scripts that I pump through the same pipeline and that don’t rely on the Update() call work. So I can use it for fire off events from button clicks, for example.

How are you loading the prefabs into the scene? Are you just Instantiating them or are you doing additive scene loading?

Sounds impossible. Create a script that you can get the Update to work for in where you reference all the things you want to call then make the things you want to call public void Update and call them inside the new script; referencedObject.Update().

Are you just Instantiating them or are you doing additive scene loading?

All in the same scene. And just to be sure, it’s instantiated after the gameobject is loaded from a prefab inside an assetbundle.

Ok, found something else out… This only happens under if they are children of some objects (all UI).

Those objects only have a RectTransform and are definitely enabled

Found it, it was a bug somewhere else that seemed unrelated at first

1 Like