I have another use cases were I don’t think would lead to bad design or bad performance.
I can’t find communication in the direction from the editor to the code. I can’t ask anything to the scene while from code I need to know everything in advance. (Almost there ):
e.g. 1) Recently I had a group of several game objects with enumerated IDs (go1, go2, go3…), that need to be created and placed in editor. I needed to associate some data and behaviour from a single script. I could pre-process the level from script Init to find all the game objects with IDs go#, but since I don’t have a go.valid(id) function or similar to stop I couldn’t do it.
Current solution. Hard code the list, update the code if the level design changes.
e.g.2) Simpler. A dummy game object that a level designer can place on a level just to tell the code to activate certain game mode or enable disable some features, anything, without having to add more code or sending messages.
In general I wish ask even more features that have being requested in other posts. Knowing the list and hierarchy of the collection game object to at least pre-process it on the Init function. Allowing to associate our “classes” with game objects, for some of us that prefer to keep code in centralized Lua modules instead of associating scripts files with every game object or collections we put on our game.
PD: Thanks for the ‘pcall’ trick. I’ll use it, but it kind of scare me… I can see pcall is used for handling exceptions !