How can I have special damage types? How can I have “special” attacks?
You can use the DamageType class attribute and the GameplayTags attribute in all of the AnimNotifies to specifiy either the type of the damage to apply or the the Gameplay Tags specific to that animation (such as Block, Parry, Knockdown, Stun, Stagger; etc.).
Then when you receive the BPI_Hitbox events in your Character class, you can query the damage type and check the tags in the container to apply your custom logic.
How do I modify/replace the damage system?
The damage system relies on a single common interface for broadcasting damage events to both victims and attackers. The interface BPI_Hitbox can be found under Blueprints/Interfaces
To replace this interface with your own system, simply follow the next steps
Open the blueprint search tool in UE5
Look up RHS_OnHit. You will get all the places where the interface methods are being called.
Double click on the interface call of the feature you want to modify (Projectiles/Beams/Hitboxes/etc) and you will be taken to the blueprint
Now remove the RHS_OnHit function and replace it with your own damage function calls. You can do this with all the feature blueprints.
How do I setup the damage in a Lyra-based project?
⚠️ Mandatory Lyra Setup for ALL features
Go under AuroraDevs_RHS/Blueprints/Interfaces and open BPI_Hitbox Select the RHS_OnHitAsVictim function and add an input of class GameplayEffect called DamageEffectClass
Make sure to select Class Reference and NOT Object Reference Open your Content Drawer Settings, and enable Show Plugin Content Go Under ShooterCore/Game and open B_Hero_ShooterMannequin Go to Class Settings and add the BPI_Hitbox interface
You may need to move the interface class to your ShooterCore folder in order to compile without errors. Override the RHS_OnHitAsVictim function and copy the following code
Animation Hitboxes
Create your damage effect class which should inherit from the GameplayEffectParent_Damage_Basic class
Open it and expand the Executions category until you find the ScalableFloatMagnitude. That’s the amount of damage caused. Set it to your desired value Go to AuroraDevs_RHS/Blueprints/AnimNotify/AnimHitbox and open BP_HitboxAnimNotifyState Open the function ApplyShapeHit Drag out the empty DamageEffectClass input from RHS_OnHitAsVictim function and promote it to a variable
You can set its default value to the Gameplay Effect class we have just created Go to your animation and select your hitbox AnimNotifyState Select the correct trace channel and the damage effect class we have just created
Normally the BaseDamage variable has now been rendered useless. Simple Projectiles
Create your damage effect class which should inherit from the GameplayEffectParent_Damage_Basic class
Open it and expand the Executions category until you find the ScalableFloatMagnitude. That’s the amount of damage caused. Set it to your desired value Go under AuroraDevs_RHS/Blueprints/Actors/Projectiles and open BP_RHSProjectileBase Create a variable of class GameplayEffect called DamageEffectClass
Make sure to select Class Reference and NOT Object Reference
You can set its default value to the Gameplay Effect class we have just created Open the OnHit function, and plug your DamageEffectClass to the RHSOnHitAsVictim function
Normally the Damage variable has now been rendered useless. Projectile Rain / Homing Projectiles
See Simple Projectiles above
Beams
In your Lyra content folder, go under GameplayEffects/Damage and find the GE_Damage_Basic_Instant Duplicate it and name the new one GE_Damage_RHS_Beam Open GE_Damage_RHS_Beam and expand the Executions category until you find the ScalableFloatMagnitude. That it the amount of damage caused by the beam each time the DamageRate variable in BP_RHSBeam_Base elapses in seconds Compile, save, exit and go back to BP_RHSBeamBase under AuroraDevs/Blueprints/Actors/Beams Create a variable of class GameplayEffect called DamageEffectClass
Make sure to select Class Reference and NOT Object Reference
You can set its default value to the Gameplay Effect class we have just created Open the DamageOnTimer function, and plug your DamageEffectClass to the RHSOnHitAsVictim function
Normally the Damage variable has now been rendered useless. Damage Volumes
In your Lyra content folder, go under GameplayEffects/Damage and find the GE_Damage_Basic_Instant Duplicate it and name the new one GE_Damage_RHS_DamageVolume Open GE_Damage_RHS_Volume and expand the Executions category until you find the ScalableFloatMagnitude. That it the amount of damage caused by the volume each time the DamageRate variable in BP_DamageVolume elapses in seconds Compile, save, exit and go back to BP_DamageVolume under AuroraDevs/Blueprints/Actors/DamageVolume Create a variable of class GameplayEffect called DamageEffectClass
Make sure to select Class Reference and NOT Object Reference
You can set its default value to the Gameplay Effect class we have just created Open the DamageOverlappedActors function, and plug your DamageEffectClass to the RHSOnHitAsVictim function
Normally the Damage variable has now been rendered useless. How do I make the projectile go towards the aim position (crosshair)?
Use the BP_SpawnProjectileAnimNotify_Player AnimNotify to make the projectile go to the crosshair location If you play in our demo map with our character, you can aim with right mouse button and shoot towards the crosshair location.