I’ve been seeing mentions of object-oriented programming using Rbx.Lua and was wondering how one would implement OOP mechanics into their game.
What are some good resources to learn about OOP in Rbx.Lua? If there aren’t any good ones, what are the basic rules of thumb when implementing OOP mechanics?
Using OOP with stock Lua is fairly annoying syntax wise. I would start by recommending either an external library, like Nexus Instance or any of the several dozen other ones, or consider using an off-platform compiler using TypeScript, like roblox-ts.
For actual OOP development, the guide linked above is a good reference.
You can use metatables if you’re looking for syntax that resembles OOP languages. Otherwise I suggest you try a OOP language first to learn what it means or how you might want to interact with it, pros and cons etc. Since the syntax itself is not needed to implement the design of OOP.