A full-fledged functional model of the weapon gun M11, with hands and animation, shoots bullets with physics rigidbody.
Additional weapon system and life-damage system.
Player - contains character control, MainCamera and weapon (child object). Here is located directly in the scene.
GunM11 - The weapon from which the player can shoot is in each hand, animated and the control is written in the controller.
Bullet - is generated when firing a weapon, has the damage, when it collides with an object containing Live, it takes away its health.
barrel - explodes when hit by a bullet (if life = 0), with an explosion damages objects around.
gun_M11_fake, magazine - automatically taken when a player approaches, replenishing the player's ammo.
target_man - just a target, at defeat it falls.
wooden_box, wooden_box2x, wooden_big_box - wooden boxes in which you can hide something (in advance to prepare), if damaged, they fly into pieces.
SoundPitchRandomizer script - is responsible for ensuring that sounds sound with different tonalities, randomly changing the pitch parameter in the AudioSource component, this creates the effect of variety, of greater naturalness.
Live.cs - Contains health value and repair / damage methods.
It is enough to place it on any object, and set up a replacement object on it when it is destroyed.
Weapon, Weapon_Gun - special behavior for weapons, and it is universal enough. The main work is done in the method Shoot().
BONUS
In the folder "Demo_Content" you can find items from my other assets
• 100ExplosionPack - explosion fire
• BreakingFruits - square watermelon
• Crumpling Drinks - 1 red can
• DestructibleFlowerbeds - 1 flowerbed
• Toucan - sound and script of explosion
Materials have an albedo, normal maps.
Texture size 1024 x 1024 in PNG.