Create Weapon Item
A unique identifier is the essence of the weapon in the system, by which it will identify it.
To create a unique identifier, go to :
Create -> Aurora FPS -> Inventory -> Equippable Item
We have created an identifier with a set of fields.
Now let's set it up and see what each of them gives us, and also consider examples of using some of them.
Property | Description |
Name | The unique identifier of the weapon. |
Type | The group to which the weapon belongs. |
First Person Settings
Property | Description |
First Person Weapon | Here we put the prefab of our weapons. |
First Person Position | Setting the initial position of the weapon. |
First Person Rotation | Setting the initial rotation of the weapon. |
Drop Weapon Settings
Property | Description |
Drop Weapon | Here we put a model of a weapon that can be selected. |
Drop Rotation | The rotation of the object when dropping. |
Drop Forward Multiplier | At what distance from the player the discarded object will appear. |
Drop Force | Setting the force of the throw when dropping an object. |
Drop Torque | Setting the torque when dropping an object. |
Equip Settings
Name | Description |
Select Time | The time of taking the item in hand. |
Hide Time | The time when the object is removed from the hands. |
Inventory Settings
Property | Description |
Reusable | Shows whether we can reuse the item or whether it will be deleted after the first use. |
UI Settings
Property | Description |
Item Image | Here we put the sprite of our weapon, which will be displayed in the HUD. |
Event Settings
This parameter is responsible for events that will occur during the use of the item.
Property | Description |
Component | Component Name. |
Function | The function of the component that needs to be called. |
Parameters | List of function parameters. |
The function will be called only if the component is located on the same object as the InventorySystem component.
Example:
We can create an apple, when using it, the "ApplyHealth" function will be called from the "ObjectHealth" component with the parameter specified by us and will restore a certain amount of health to the player.
Last updated