On the surface, game object properties are useful for editor integration and various go.___() API calls. However, they also seem to have a less obvious purpose when looking at functions like resource.material(), where these sort of references must be attached to a property rather than a local Lua variable.
What’s the reason for this requirement of using properties to store references to resources? My best guess at the moment is that all properties are analyzed, and any resources found are included in the build instead of excluded, which is the default behavior to keep build sizes down.
This is correct. Using resource properties (ie go.property("foobar", resource.material(""))) will allow the build system to detect them and include the references files in the application bundle.