BasicWeapon blueprint now supports a lot but it isn’t supporting automatic fire like assault rifles have. It will be really simple to implement now.
Rifle should use automatic fire,
We will use existing functionalities to drive this weapon,
Basically I will implement almost all of the weapons from Military Silver Pack and then move forward with gameplay. I want to have BasicWeapon functionalities fully implemented and tested out.
In earlier post we have added shooting functionality for base weapon. Now let’s upgrade this class to support Shotgun that came with Military Weapons Silver package.
Shotgun will fire more bullets than other weapons, (Burst functionality)
Its single shoot shotgun with automatic reloading, (custom reload functionality)
Spread will be different,
Impulse for ragdoll will be different, (Add ImpulsePower to BaseWeapon)
This tutorial contains basic knowledge about AI / Animations . If you are interested in graphics and animation, go to this website and watch more such tutorials. It may be complicated for beginners so please take your time to analyze the stuff before implementing. I will create first basic enemy and it will cover:
Behavior Tree: simple check where to go and go there if aren’t reloading,
Animations: blending legs with rest of the body (walking -> standing),
Animations: Playing Montages (reload animation and shoot animation),
Animations: Look At – enemy upper body will be always rotated to player,
Animations: TakeDamage effects without having animations,
Dynamic crosshair that will tell me what’s the current spread,
Crosshair and spread is one of my favorite topic. You can read here great article about aim systems, and math behind spread in AnswerHub. Let’s try to do this by our self!
Military Weapons Silver asset package comes with almost all particles needed for weapons and ready to use: muzzle flashes, impact particles and trails. It have shell mesh as well, but it doesn’t have shell FX added. Before we move forward with next tutorial about weapons let’s create shell particle. It’s super easy!
In this post weapon won’t fire any projectile yet but you will learn more about blueprint communication, creating animations in blueprints and doing recoil directly in animation blueprint, also if you’re interested in firearms and shooting you can get experience in sites like Allaboutshooting online that will help you understand this better so you can apply it in your work.