onDisable is called even if onEnable was not?

Hey guys,

Just stumbled upon this:

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'length')
    at OrbitControls2.onDisable (chunk-K4LBNQTN.js?v=29c165a8:46369:38)
    at chunk-K4LBNQTN.js?v=29c165a8:26172:18
    at perComponent (chunk-K4LBNQTN.js?v=29c165a8:26213:7)
    at updateIsActiveInHierarchyRecursiveRuntime (chunk-K4LBNQTN.js?v=29c165a8:26161:7)
    at updateIsActive (chunk-K4LBNQTN.js?v=29c165a8:26126:25)
    at GameObject.setActive (chunk-K4LBNQTN.js?v=29c165a8:39149:5)
    at MyClass.awake (MyClass.ts:23:18)
    at MyClass.__internalAwake (chunk-K4LBNQTN.js?v=29c165a8:39748:10)
    at safeInvoke (chunk-K4LBNQTN.js?v=29c165a8:25893:7)

Both objects are part of the same prefab/AssetReference. MyClass is deactivating the OrbitControls object during awake. Edit: Both components actually sit on the same object.

Anyway, I think onDisable should only be called when onEnable was called before.

I’m sorry, I couldn’t find a response but notified the team :cactus:

1 Like