Item
What are items?
Items are 3D objects within a space. The position and state of items are generally the same for everyone in the space (this is referred to as “synchronized”). By assigning attributes to items, they can be grabbed and moved, sat on, or ridden. Both Trigger/Gimmick and ClusterScript also operate based on items as fundamental elements. Most interactions are described as actions between items, or between items and players.
Item types
There are two types of items, each with distinct characteristics:
- World items
- These are Unity GameObjects or prefabs created as part of a world within Creator Kit, configured as items.
- World items are tied to specific worlds and cannot be dynamically generated in other worlds.
- Assets that make up world items, such as textures, are shared with the world’s landscape and other world items, and are loaded when the world is loaded.
- Craft item
- These are portable items created with Creator Kit or other tools, mainly used in World Craft.
- Craft items can be dynamically generated with more flexibility, and it’s possible to create craft items without using Unity.
- The assets that make up craft items are self-contained within each craft item, and do not reference other items or worlds.
Item templates and dynamic item generation
World items are generally statically placed in Creator Kit (before uploading in Unity). These are called world-placed items. However, it’s also possible to generate items dynamically within a space instance.
Here are specific methods for dynamic generation:
- Executing Create Item Gimmick component
- Calling the ClusterScript.createItem API with World Item Template List component
Dynamically generated items are called world-generated items, and the prefabs used as the source for generation are referred to as world item templates.
Craft items can also be placed by users manually in World Craft, or generated dynamically via ClusterScript. However, unlike world items, these two methods are treated the same within the system. Therefore, they are collectively referred to as craft items. The data that serves as the source for craft items, in PITM data format, is referred to as craft item templates.
In places where precise distinction of terms is unnecessary, the following abbreviations are typically used:
- World item template → Item template
- Craft item template → Craft item
- Item template → Item
- And so on…
How to configure items
All items require Item component. By adding other components, various behaviors can be achieved.
- Movable Item component : Allows the item to move via physics or animations.
- Grabbable Item component : Allows players to grab and move the item.
- Character Item component : Enables movement with the Character Controller component.
- Ridable Item component : Allows players to ride (sit) on the item.
To enable more complex behaviors in items, additional components are also used.
- When using Trigger/Gimmick: Retrieve information via Trigger components, reflect actions with Gimmick components, and insert conditional logic with Operation components.
- When using ClusterScript: Add Scriptable Item component to write scripts for the item.