top of page

Finishing shooting mechanics

For this update I finished off the shooting mechanics. I have added a small particle effect to spawn at impact points and recoil to the player's weapon. When the player fires a shot, a line trace hits an object. The object type is cast to the AI character, if the cast is successful then the AI will lose health. Small Yaw and pitch inputs are then added to the player controller to simulate recoil. I also added an automatic reload when the player tries to fire with no ammo.

Recoil is added using a timeline to make it a smooth transition between positions.

I used a pretty informative for this part as i had no idea where to start. This is just another thing that I have learned during the course of this project.

Tutorial reference: https://www.youtube.com/watch?v=VGmaG8uMCcc&t=1878s

The AI health system is pretty simple. An enemy has 100 Health, which is checked on every hit. If it is less than 0 then a death event is called.

For the AI shooting mechanics I did something a little different. Since The AI doesn't know to stop shooting and wait for the recoil to settle, I added some random aim deviation to simulate a similar effect. The random aim deviation involves breaking a vector and adding random floats to the X,Y and Z axis.

Update video


Recent Posts
Archive
bottom of page