Why: the goal or problem

Many game objects share capabilities but combine them differently. One large script per object repeats responsibilities.

How: work toward a solution

The schematic contains a player, floor, camera, and one collectible. Move to item triggers authored contact logic: score changes from zero to one and the item disappears. Repeat contact cannot score again. Disable contact before moving to demonstrate a missed collection: score stays zero. Reset or reload restores the player and item. This is a concept simulation.

Unity: concept simulation

Concept simulation

Unity

Move the player into the item. Authored contact logic awards one point and removes it.

PIC
P: Player · I: Collectible · C: Camera · ─: Floor

Score: 0 · Collectible: Present

Initial scene: four GameObjects

Player · Floor · Camera · Collectible

Transform
Renderer: visual
Collider: contact
Script: award once

A fictional demo within this article. Reset or reload restores its initial state.

What: the concept

Unity GameObjects contain components. Transform, rendering, collision, and authored scripts provide distinct responsibilities; an object name alone does not implement gameplay.

Keep score ownership clear and test component references.

Source