Platformer PRO provides support for many kind of collectible items, armour, weapons, power-ups, etc. Before you can create and use items you must setup your ItemTypeManager.


Once you have an ItemTypeManager, then to get started with Items:

  1. Add an ItemManager to your Character GameObject (see ItemManager below).
  2. Make sure your character has a correctly set up HurtBox or other CharacterReference.
  3. Add a GameObject to represent your item. Make sure this is in a non-geometry layer that can interact with Characters (e.g. the 'Collectible_Projectile' layer that is setup by default).
  4. Add the Item component to your Item GameObject.
  5. Add a 2D collider to your Item GameObject.
  6. Create a GameObject that is a child of your Item GameObject
  7. Add a visible component (such as a SpriteRenderer) to this child GameObject.

Note: Its not vital that the visible component be a child but this is good practice as it allows you to effect the visible component of the item without affecting its behaviour.

Item Classes

There are four types of items:

STACKABLE An item that can be stacked up in the inventory until some maximum is reached. For example coins or stars.
SINGLE An item of which the player can only have one.
KEY Special item type used to unlock doors. See Doors for more information.
POWER_UP  Special item type which grants the user new powers. See Power Ups. 


Item Type

The item type is a string identifier for the type of item. It will be chosen from the list of items defined in your ItemTypeManager.

Create a Stack of Items

If you wish to add more items to a stack (e.g. 10 bullets instead of 1), update the Item component to instead be a StackableItem. And enter an amount in the Amount field.

Item Manager

The ItemManager component handles collecting and using items. It must be added to your Character GameObject or to a child of your Character GameObject.

Configuring Stacks of Items

The ItemManager allows you to configure stackable items by adding one or more items with the following details:

Type   Unique ID for the item type (e.g 'fuel' or 'COIN').
Max Maximum number of items allowed (i.e. how many can the Character hold).
Starting Count Allow your character to start with some of this item. For example you may want to start with 20 bullets or 100 fuel.


Configuring Persistence

The ItemManager is a Persistable (see Persistables) and thus allows you to persist the state of the items between levels, games or even play sessions. See PlatformerProGameManager. 

Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk