<aside> 💡
WIP
</aside>
About 12 years ago I came across this presentation: https://gamedevacademy.org/lessons-learned-in-unity-after-5-years/ where the author explains the Actor pattern.
In Unreal Engine we have something similar, an actual subclass to their “GameObject" type named actor. And each scene object must inherit from it.
More developers have found “Actors” to be useful: https://delightful-games.com/actor-oriented-design-in-unity/
The idea behind actor is manifold.
An Actor is your entrypoint to a self contained Object. This object fulfills a certain role in your game. It usually has some form of state.
The easiest example would be a CharacterActor or a DestructableActor or a CollectableActor
Actors typical have a position and bounds. And they have some game logic attached to them.
Static Meshes (✔ position and bounds, ✘ logic, ✘ state)
Trigger Zones (✔ position and bounds, ✔ logic, ✘ too simplistic state (on/off))
They are ususally not the owner of the state, they usually do something with Actors
Projectiles (✔ position and bounds, ✘ logic is too simplistic, ✘ state too simplistic)
We don’t need to bother with a ProjectileActor. it’s usually straight forward and usually it interacts with Actors, but Actors never interact with it.
The Actor Inhertiance structure will likely be 2-3 levels deep, the first level being a simple abstract base class.