1. I am writing a mod which I would like to increase \ decrease recoil of certain guns and change how they work.
    Code:
    BaseProjectile proj = item?.GetHeldEntity()?.GetComponent<BaseProjectile>() ?? null;
    I use this to get the BaseProjectile component of the Gun

    I then modify some stats like so
    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];
      }
    
    However no matter what I change any of these values to the guns seem completely unaffected.
    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.
     
  2. Most likely because the recoil is handled to some extent on the client