MetaTable game applications?

I know how meta tables work but what are some real game applications that there used for?

I’m pretty sure they can be used in many different types of games, but there’s only one type of instance I’m aware of. This is in fps games.

I think its object based, or scope based, as its easier to create functions or methods for certain objects?

for example you can have a do loop for a scope, with a set of functions, and instead of writing out a full path to the function you can just do table:func().

local scope = {}

    local self = scope
    --idk what you do here tbh, I haven't used metatables in long time

I’m not really sure though…

This has nothing to do with metatables. Perhaps you’re thinking of the colon syntax that is often used when constructing functions:

function Object:Method(argument)
    self.X = self.X + argument

(which still has nothing to do with metatables)

1 Like

I only use metatables when implementing inheritance into an object-oriented system. I covered this in another reply:

1 Like