Limits and crashes
Scripts run in a sandbox, so one broken script cannot freeze or crash StageTime.
When a script crashes
A script that divides by zero, reads past the end of an array, uses a null reference or breaks a limit below is stopped on that player's device and logs one error with the reason. The rest of the world keeps running. If a method of another script crashes, the script that called it stops too.
Limits
| Limit | Value |
|---|---|
| Work per event | about 200 000 instructions for everything one event does, including other scripts it calls. An endless loop stops the script instead of freezing the frame. |
| Memory per event | 8 MB of new strings and arrays |
| Strings | 16 384 characters |
| Arrays | 65 536 elements |
| Synced data | 96 words per script (details) |
| Synced strings | 60 bytes (UTF-8) |
| Delayed events | 64 pending per script |
| Scripts calling each other | 8 deep |
| Logging | 20 lines per second per script |
| Compiled script | 1 MB |
Performance tips
- Avoid work in
Updatethat only needs to happen sometimes. UseSendCustomEventDelayedSecondsfor timers. - Build strings only when they change, not every frame.
- Keep mirrors and real-time lights few: standalone headsets have little GPU to spare.