How exactly do explosions and simple damage add force to Health objects ?

Cheo

Active member
Hello, I'm sorry if this question sounds stupid, but I'm having a hard time understanding just where exactly do added forces come from when using an explosion that triggers the Simple Damage impact action onto an object with a Health component ? Basically, I'm shooting a rocket near an enemy character and the blast kills and projects him, but I just don't understand which line exactly triggers this projection. Hope you can help me, thanks in advance.
 
The SimpleDamage module calls DamageProcessorModule.Process/ProcessDamage within the OnImpactInternal method, and it's here where eventually Health.Damage gets called because it implements the IDamageTarget interface. For the best visualization of this I recommend placing a breakpoint within Health.Damage and then looking at the call stack.
 
I took another look at the OnDamage void in Health, it contains three Force methods (AddForce, AddForceAtPosition, AddExplosionForce) and I'm not detecting either of these when killing the enemy with a rocket blast - I can even comment them out and the enemy still gets projected by the blast ! I'm sorry to bother you with this, but I honestly don't understand where this force comes from.

One other thing's been bugging me since last night : both the SimpleDamage and Health scripts check for a ForceObject first and use AddForce on it if it is found, but the IForceObject interface is only used on the TrajectoryObject class. Am I correct in assuming that this check was initially aimed at UltimateCharacterLocomotion objects ? Because living UCC characters are not propelled by an explosion's blast if it doesn't kill them, and that's a feature UCC should have by default.

Edit : Never mind that, I completely forgot about the AddForce impact action, sorry I wasn't looking at it with a clear mind :/
 
Last edited:
Top