Resource Handling (Ammo/Heat)

Ammo

To create limited ammo for projectile weapons and missile weapons:

  1. Add a Resource Container component to the weapon and customize the inspector settings.

  2. Go to the Weapons component on your weapon and go to the Resource Handlers list in the inspector. Add an entry to the list.

  3. Drag the Resource Container you created above into the Resource Container field, and set the Unit Resource Change to -1 (this will remove 1 from the ammo container when the weapon is fired.

Now, the weapon will deplete the ammo container, and not fire when the ammo is empty.

Heat

To produce heat when the weapon is fired, repeat the steps for the Ammo section above, but set the Unit Resource Change to a positive number in step 3.

You can define different resource types with Resource Types, which you can create in the Project tab with Right Click > Create > VSX > Resource Type.

Last updated