Skip to content

Spawnables

GreasedScotsman edited this page Sep 28, 2022 · 1 revision

Icon Spawnable Crate

Spawnable Crates are spawnable, physical objects that must have at least one rigidbody. These are currently limited in functionality to loading rigidbody prefabs, but will be the main way to include guns, melee weapons, NPCs, destructible boxes, basketballs, etc. in a level.

Creating a Spawnable Crate

  1. Create a prefab for the spawnable item.
  2. Select the Pallet from the Asset Warehouse window.
  3. In the Inspector, click Add Crate.
  4. In the Create Crate window, fill out the Crate Title field and select the prefab of the spawnable item for the Asset Reference field.

Adding the Spawnable Crate to the Level

First Method:

Image Image

Ensure the Asset Warehouse Spawner Overlay is visible in the Scene view. (The Overlay will have the Spawnable Crate icon and may be docked in the toolbar. If so, click the toolbar icon to show the Overlay. If the Overlay is completely hidden, press Space, the select AW Spawner from the list of overlays to reveal it.)

  1. Select the Spawnable you want to add to the scene in the Asset Warehouse.
  2. In the SceneView, drag and drop the Spawnable icon into the scene where you want to place the item. This method will automatically add the Spawnable Crate Placer component and fill the Spawnable Crate Reference field with the Spawnable Crate selected in the Asset Warehouse.

Second Method:

  1. Create an Empty GameObject at the location where you want to place the Spawnable.
  2. Add the Spawnable Crate Placer script to the GameObject.
  3. Open the selection picker using the circle button to the right of the Spawnable Crate Reference field.
  4. Select the desired Spawnable Crate.

Clone this wiki locally