03/05/2018 - 14/05/2018
Weapon - AK 47 - Shooting
creating the projectile base
after creating and attaching my first weapon i had to move on to allowing the player to be able to shoot the weapon otherwise it'll be just a melee weapon. the first thing i did to make this a reality was add a projectile base ( the bullet) which would be what the player would be shooting when he pressed the Left mouse button. to create this i right clicked, selected blueprint and selected the actor class as seen in the image above.
collision, projectile movement and sound
after creating the actor class i clicked on add component and added the capsule collision and also added the sound and projectile movement speed using the add component drop down to make it more interesting as seen in the images above.
blueprints for the bullets
lastly after creating the projectile base which was easy i had to add a few blue prints to make sure that when the player clicks on the left mouse button the projectile not only comes out but comes out at the end of the gun and nowhere else.
shooting blueprint
firstly as seen in the images above i created the shooting blueprint which was based in the weapon base ( my main weapon) event graph which is split into 3 custom events, pull trigger, release trigger and fire which do as labeled and communicate not only with each other but with the third person character's blue print for this weapon to make sure it works.
muzzle
Left mouse button
lastly i had to add a command to my third person character to make sure he shoots when the player pressed the left mouse button although the blue print looks complex at its current moment it simply means when you press the left mouse button the character shoots out of the muzzle, i will however explain the extra components that i added in later on.
this video shows what it looks like when i shoot:
Comments
Post a Comment