Hello,
I think I found a bug in the initialize()/postInitialize() order when later enabling an entity that was disabled when the app was started. To make matters worse, my app was still working with PlayCanvas 0.218.0 ded6028 and now isn’t with 0.219.3 f5f75ce, so I assume it was introduced in the meantime.
When an entity has two scripts, I would assume the following on start:
- Script A initialize()
- Script B initialize()
- Script A postInitialize()
- Script B postInitialize()
And indeed that’s what happens if the entity is enabled at start.
With PlayCanvas 0.219.3 f5f75ce, the following happens when the entity is disabled at start, but is enabled later:
- Script A initialize()
- Script A postInitialize()
- Script B initialize()
- Script B postInitialize()
I built a minimal example project to demonstrate the problem. Launch it, open the console and press space to enable the second object.
All the best,
Tobias
edit: I realized that this is perhaps better suited as a bug report, so I filed one.