Learn more about tagged machines and what you can use them for.
Tagged machines are Unity components that are added to game objects. They’re mostly used for starting game mechanics on objects through schematics, like destroying it after losing all health – on the player, this should trigger a game over, while the enemy should just be destroyed.
A tagged machine component can be added through the components menu (Makinom > Machines > Tagged Machine) or the scene wizard (Add Machine > Tagged Machine). A game object with a tagged machine is represented in the Unity scene view by this gizmo icon:
You can learn more about machine components in general and their basic settings here.
A tagged machine is started by schematics or timelines through passing on one or more tags, i.e. short identification texts.
The tags the machine can be started with are added in the machine’s settings – depending on the schematic/timelines call, either all or only one of the tags passed to the machine must match the machine’s tags.
A schematic tries to start tagged machines on a game object and uses the following tag (only one needed):
The game object has 3 tagged machines:
Tagged machine C will be started by the schematic.
A timeline tries to start tagged machines on a game object and uses the following tags (all are needed):
The game object has 2 tagged machines:
Tagged machine B will be started by the timeline.
Tagged machines are useful to start different game mechanics on different game objects through the same logic. Using a tag to start machines on different game objects allows using other schematics or timelines for the same tag.
E.g. the death tag can cause a barrel to explode with an explosion particle effect, an enemy to fall dead to the floor and vanish, and the player to display a game over message and restarting the level.
A projectile with a collision machine tries to start tagged machines on the game object it hit using the tag hit.
The projectile hits different objects:
A schematic reduces the object int variable health of a game object – if health falls to 0 or below, the schematic tries to start tagged machines on the game object using the tag death.
The schematic is used on different objects:
© 2015 Gaming is Love e.U.
Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!