I am writing a mod which I would like to increase \ decrease recoil of certain guns and change how they work.
I use this to get the BaseProjectile component of the GunCode:BaseProjectile proj = item?.GetHeldEntity()?.GetComponent<BaseProjectile>() ?? null;
I then modify some stats like so
However no matter what I change any of these values to the guns seem completely unaffected.Code:proj.recoil.ADSScale = 1.0f; proj.recoil.clampPitch = 0; proj.recoil.movementPenalty = 0; proj.recoil.recoilPitchMax = 0; proj.recoil.recoilPitchMin = 0; proj.recoil.recoilYawMin = 0; proj.recoil.recoilYawMax = 0; proj.recoil.shotsUntilMax = 9999; proj.recoil.timeToTakeMax = 50.0f; proj.recoil.timeToTakeMin = 50.0f; proj.recoil.useCurves = true; for (int i = 0; i < proj.recoil.pitchCurve.length; i++) { proj.recoil.pitchCurve.keys[i] = proj.recoil.pitchCurve.keys[0]; }
I have a chat command setup to then log all the stats which I use before and after and can see the new values have taken effect but nothing about the gun changes at all.
Modifying Gun Stats (Recoil, Sway) isn't doing anything?
Discussion in 'Rust Discussion' started by Kriogenic, Dec 13, 2017.