Entity feature

Describe your feature request here as clearly as possible, and explain why you’d like to see this added to Crayta.

It would be great if the Entity metatable would provide the functionality to forward __index/__newindex to a script that is attached to the entity.

So let’s say i use entity.randomVariableName=10.
This currently leads in an error since the entity can’t handle that.

The feature that i desire would allow the following:
I could attach a script named “__meta” to that entity.

I could add a function called
“function __meta:__newindex(…)”
to that script, which then would receive the value (10) and allow me to handle it in Lua. This would be compatible to everything that existed prior to this and not harm anything at all. It would also allow creating functions that seamlessly expand entity utilities that we currently have.