Item creator window is a tool that helps automate the creation of weapons.
It adds all components and other objects that need to be created for a weapon to function properly.
It creates default collider ( box collider ) on a weapon which you can delete and replace with better fitting collider/s.
Also, you can manually add 'ItemTrigger' that will pick up
weapon upon player entering it. Mostly used for a top-down
player mode.
'ItemTrigger' can be found in 'Prefabs/Triggers' folder.
Usage:
- open by clicking 'Tools/Combat Framework/Item Creator'.
- drag game object that will act as a weapon.
- enter a name, choose a type of weapon, enter melee damage and range.
If a weapon is ranged ( one-handed and heavy also can be ranged ) more options appear.
- choose 'Burst Mode' - burst type of weapon ( single, burst, auto ).
- Mandatory: drag fire position transform from which weapon will fire to 'Fire Transform(Position)' field.
- enter transform at which discarded shells will eject to 'Eject Transform(Position)' field.
- choose empty mesh and drag it to 'Empty Shell Mesh' field.
You can use existing one from models folder ( 'Models/empty_bullet_shells.fbx'. )
- set 'Num Shots Before Reload' field - number of shots before reloading: its the size of magazine/clip.
- set 'Ranged Damage' – damage that will be applied when hitting with a projectile.
- set 'Num Rays Thrown' field - number of rays thrown per shot
- spread of shot ( accuracy: zero = perfect )
- set 'Projectile Speed' and 'Hit Force' - a force that will be applied on hit object. ( rigidbody if not kinematic )
- drag 'Ammo Object' – object that will be set in left hand upon reloading like magazine clip.
- enter 'HitMask' - layers that projectile will collide with.
Fields can be modified after creating a weapon.
NOTE: Be sure to make resource ( drag to 'Resources/Items'folder ) of a newly created weapon and assign name to
'Original Prefab Name'. It is needed for scene transitions so that weapon can be loaded properly.