Flem100
New member
Hello there. I have imported Rayfire 2 asset into my project, as well as the UCC integration package.
Reproduce error:
If I go into PistolWeaponRight and open Impact Module Group -> SimpleDamage and change it to UseContextData it doesn't help.
I looked at in a screen share with Cheo. He was the one telling me to try these things because I am still a noob with UCC
.
His solution is to instead use the Health component and call the Rayfire functions directly from Damage or OnDeath events. That makes sense, but you might have a good reason to do it the other way and I would like your opinion before I continue.
Codex (OpenAI's "Claude Code"), suggests to edit SimpleDamage.cs OnImpactInternal() and set the missing properties after damage is calculated.
Reproduce error:
- Choose 1 of the green Cube game objects from the UCC Demo scene.
- Remove Rigidbody and Collider.
- Add Rayfire Rigid and the only thing in the integration; the RayFireImpact component.
- Make the following changes to the Rayfire Rigid component:
- Initialization = At Start.
- Optional. In the Damage section. Enable = true. Error happens either way
- Start the game and shoot at the cube with the Pistol.
Because ctx.ImpactDamageData is null. It seems to be because the weapon is not an impact weapon like the grenade.The code dies here:
m_RayfireRigid.ApplyDamage(ctx.ImpactDamageData.DamageAmount * m_DamageMultiplier, ctx.ImpactCollisionData.ImpactPosition);
If I go into PistolWeaponRight and open Impact Module Group -> SimpleDamage and change it to UseContextData it doesn't help.
I looked at in a screen share with Cheo. He was the one telling me to try these things because I am still a noob with UCC
His solution is to instead use the Health component and call the Rayfire functions directly from Damage or OnDeath events. That makes sense, but you might have a good reason to do it the other way and I would like your opinion before I continue.
Codex (OpenAI's "Claude Code"), suggests to edit SimpleDamage.cs OnImpactInternal() and set the missing properties after damage is calculated.