Weapon Specific Impact Sounds
Last updated
Was this helpful?
Last updated
Was this helpful?
Soulslike Framework comes with an example sound handling system that is tied to the combat. & the are responsible for handling the sounds.
However, for some projects, this might be limiting. In this page, we will look at how we can extend this system.
Start by adding a new property of type SoundBase to the Base Weapon Actor (B_Item_Weapon):
Now, head into AC_CombatManager and find the HandleIncomingWeaponDamage method. We'll add a new input for our new sound property:
Let's ensure that we pass this new property we created to this method inside the Base AI Weapon class (B_Item_AI_Weapon):
Back in AC_CombatManager, lets adjust the main method for handling incoming weapon damage (this is where the passed sounds are being played):
Adjust the sound logic that is triggered when player's Stance is broken:
Adjust the sound logic that is triggered if player is not guarding:
That's it! Now, you can give each AI weapon actor its own impact sound:
You can adjust the similar methods in AC_AI_CombatManager to also make player weapons' impact sounds specific to each weapon.
Head inside AC_AI_CombatManager component and create new properties for:
Unarmed Impact Sound
Unarmed Guard Sound (when unarmed attack has been guarded by player)
Unarmed Perfect Guard Sound (when unarmed attack has been perfect-guarded by player)
Then adjust the ApplyFistDamage method:
Head into the AC_AI_CombatManager component and into the HandleIncomingWeaponDamage_AI method. Add a new input pin of type SoundBase:
Adjust the sound logic in the method to utilize this new pin we added:
Then, create a new property inside AC_CombatManager for the unarmed impact sound. Head inside the ApplyFistDamage method and utilize this new property: