Skip to content

Creating an USS Shop

Honeycomb936 edited this page Apr 7, 2024 · 1 revision

A shop is the essential part of USS. It consists of an empty gameobject with a collider on it (preferrably a box one), which must not be set to trigger, and an ItemShop component on it.
The component contains the main shop settings:

  • Shop ID, needed for saving and loading, has to be unique
  • Item name to be displayed as you look at the shop, the bought item name is just the name of the item prefab
  • Item price
  • Shop position and rotation (relative to the store_inside gameobject), see also tweaking the shop position in-game
  • Item prefab to be spawned when you buy items from the shop - drag your previously created prefab here
  • Spawn in bag (true/false) - decides whether the item spawns in a bag (recommended for small items) or on the floor in front of the counter (for bigger items)

USS Shop Setup

To find out the transform values for shop position and rotation, you begin with setting it to 0, 0, 0, and then after you have done everything else and got the shop in game, reposition it using USS commands and Developer Toolset. For that, please visit Positioning Shops With Commands.

Now as you set up the shop component, you still need to fill the shop with items to later be displayed in the shelf.
For that, you need to add gameobjects with only mesh and texture (and transform ofc) to the shop gameobject. Arrange them to your liking, but remember to keep them inside of the box collider boundaries. Also, don't forget to variate the rotation a bit to make them look better. The finished hierarchy structure should look like this:

Shop Hierarchy

The names of the gameobjects don't matter, they will get removed from the top down. Due to that, it's important that if you stack items in the shelf, you need to ensure they're ordered correctly in the hierarchy - otherwise you might get floating items in your shop shelf.

After this step, you are ready to build your AssetBundle. You only need to add the shop prefab to the bundle. The item prefab will be linked automatically.

When building your AssetBundle is done, continue with Adding an USS Shop to the Game.