Item Component

From Pummel Party Mod Documentation
Revision as of 02:37, 27 October 2022 by RBDev (talk | contribs) (Big content dump)
Jump to navigation Jump to search

The item component is a gameplay component that creates a collectable item that the player can hold, wear, and use.

This component cannot be added through the inspector and instead must be created from the Hierarchy Window by right clicking or from the GameObject toolbar menu. It is created by choosing Minigame Object > Item. This will create a gameobject with an item component.

Gameobjects with an item component cannot have any child gameobjects, and will appear a unique color in the hierarchy.

There are three types of items. Each item type is intended for different use cases. The item type affects the properties and attributes available for the item.

Carried Items

Used for items that you can hold and use to perform some actions.

Weapon Items

Used for items that can attack through firing when used.

Worn Items

Used for items that are purely visual, or that provide a buff via actions while held. These do nothing when "used" by the player.

Component Settings

General Settings

Property Description
Item Type The type of the item. Can be either Carried, Weapon or Worn.
Item Slot Which slot on the player should this item occupy.
Item Hold Animation The animation to play while this item is being held.
Item Prefab The prefab representing the item's visuals.
Unique Drop Prefab Should a different prefab be used when the item is dropped on the ground.
Dropped Item Prefab The prefab representing the item's visuals when dropped on the ground.

Weapon Settings

These settings only apply to Weapon-type items.

Property Description
Weapon Type The type of weapon. Can be Melee or Gun.
Damage Type How damage is dealt by the weapon.
Hit Scan The weapon fires discrete hitscan projectiles.
Damage Number of health points to remove from any hit players, per bullet.
Shot Count Number of bullets shot each time the weapon is fired.
Spread Number of bullets shot each time the weapon is fired. Can set the min and max horizontal and vertical spread, in degrees.
None All bullets come out exactly where the player aimed.
Random Bullets come out where the player aimed, plus some random aim offset.
Max Distance Maximum distance the bullets can travel in units.
Spawn Bullet Effect Should a tracer effect be played to vizualise the bullets.
Bullet Color The color of the bullet tracer.
Spawn Trail Effect Should a longer lasting secondary tracer effect be used.
Start Color Color of the secondary tracer at the end closest to the origin of the shot.
End Color Color of the secondary tracer at the end furthest from the origin of the shot.
Trail Width The width of the secondary tracer effect.
Trail Length The length of the secondary tracer effect before it fades out, from the origin of the shot.
Beam The weapon fires a continuous hitscan beam. Shares most properties with Hit Scan weapons.
Beam Damage Cooldown Time between each tick of damage being applied to the target.
Area The weapon deals damage to all objects within an area.
Shape The shape to deal damage within.
Point Deal damage to anything that overlaps a point.
Sphere Deal damage to anything that overlaps a point.
Radius Radius of the damage sphere.
Fire Sound The audio clip that plays whenever the weapon fires. Can choose from None, Rifle, Shotgun, Sniper and Custom which allows any audio clip to be used.

Pickup Settings

Property Description
Dont Pickup If Already Holding An Item If this item should not be picked up if the player is already holding an item in this item's slot.
Item Pickup Priority The priority assigned to picking up this item. If it is greater than that of the item currently held in the same slot, the held item will be dropped and this one will be picked up.
'On Pickup' Actions A set of actions to perform whenever this item is picked up.

Held Settings

Property Description
Held Position Offset An offset to apply to the position of the item when it is held. If the item is a strange shape or should be held differently given the Item Slot and Item Hold Animation, you can adjust it's positioning here.
Held Rotation Offset An Euler x, y, z rotation to apply to the item when held.
'While Held' Action Delay (s) The number of seconds between each firing of the 'While Held' Actions.
'While Held' Actions A set of actions to perform while the item is being held. Fires constantly with a delay of 'While Held' Action Delay (s) between each firing.

Usage Settings

These settings are only available on carried- and weapon-type items. Worn-type items cannot be "used" so these settings do not apply.

Property Description
Cooldown The number of seconds that must pass between each use of the item.
Has Limited Uses Should this item be dropped after a set number of uses. If false, this item can be used infinitely.
Drop After Uses The number of uses before this item will be automatically dropped by the player.
'On Use' Actions A set of action to perform whenever this item is used.

Drop Settings

Property Description
Can Be Dropped When false, the player is not able to drop this item using the drop button.
Automatically Drop After Time Should this item be automatically dropped by the player after an amount of time has passed.
Drop After Time (s) Number of seconds that will pass from the time of item pickup before the item is automatically dropped by the player. Will still drop if Can Be Dropped is false.
Disappear When Dropped Should the item destroy itself when it is dropped.
Drop On Death Should the item be dropped by the player when the player dies. If false, the player will respawn holding the item.
'On Drop' Action A set of actions to perform whenever this item is dropped. Will fire if dropped for any reason, not just the player pressing the drop button.

Example Usage

  • Powerups
  • Weapons
  • Collectables (Coins)