Weapons Fixs

 Author: Parker Boyer

Problem:

This week I decided to continue with implementing gun functionality to have multiple types of guns instead if a single fire pistol. Some problems I ran into were dealing with not able to make a child actor and fixing damage so it reads from what damage is set in the weapon instead of the bullet blueprint so different weapons can deal more or less damage. As well as trying to figure out how to get a spread and multi-shot functional for assault rifles and shotguns.

Solution: 

Dealing with child actor so i can modify the stats of each weapon was a simple fix of realizing i was duplicating the blueprint instead of creating a child actor somehow. As for the damage the fix was as simple as setting my bullet damage in the weapon to the bullets base damage allowing me to mess with the damage without going into the bullet

For the spread to work i had to do some research and trial and error with angles and found a cone method unreal had which automatically sets a random position and rotation within the angle you desire.

Random Spread method:

Setting Y axis to 0 so bullets don't go up or down in top down shooter:

As for the multi-shot i just had to make a loop that's last index was the amount of bullets set to before spawning so the engine knows how many bullets to spawn each shot.





Comments

Popular posts from this blog

Procedural Generation - Room NavMesh Spawning

Powerups and Wall clipping