Eonirr

Untitled

Mar 10th, 2026 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. [SerializeField] AnimationCurve knockbackScaling;
  2. [SerializeField] float baseKnockback = 10f;
  3. [SerializeField] float maxStrength;
  4. [SerializeField] float strength;
  5. [SerializeField] float currentKnockback;
  6.  
  7. public void UpdateStat()
  8. {
  9. currentKnockback = ComputeKnockback(strength, maxStrength);
  10. }
  11.  
  12. float ComputeKnockback(float stat, float maxStat)
  13. {
  14. float t = stat / maxStat;
  15. float multiplier = knockbackScaling.Evaluate(t);
  16. return baseKnockback * multiplier;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment