Game dev
Saved & recent

Component

Related terms: composition, game object, object lifecycle, ECS

A reusable part attached to a game object: a collider, an audio player, a health script or a renderer. In an object-based component design, a component can hold both state and behavior and receive lifecycle callbacks.

Build a door by combining a model, a collider and a door script. This is composition: assembling behavior from parts. In ECS, components are typically data while systems perform the work.

Further reading
Unity: Add components to GameObjects
mesh renderer box collider door script interaction open() door object
A visible model, a collider and a script are separate parts of the same door. Each handles a different job.

View in the full Game dev collection