Profile image

How do you cap out sum()?

6,493 GrandPrix  1.3 years ago

I’m making a tank turret and I need to cap out sum() without using clamp(sum(Pitch),1,-1) this is because it will continue to add when it’s past the value. Help

  • Log in to leave a comment
  • Profile image

    Use the smooth alternative
    smooth(sum(1)<0.1 ? START_VALUE : (INPUT<0 ? MIN_VALUE : MAX_VALUE), abs(INPUT))

    • float START_VALUE: Value to initialize the function with, usually 0.
    • float MIN_VALUE: Minimum output value.
    • float MAX_VALUE: Maximum output value.
    • float INPUT: Input that corresponds to the argument of sum(...).
      .
      Added to ft list
    +1 1.3 years ago
  • Profile image

    Idk how to do funky trees lol

    1.3 years ago
  • Profile image
    6,493 GrandPrix

    That’s not how you do it lol. I’m not falling for that @ThatRandomCouchPotato

    1.3 years ago
  • Profile image

    Go to max/min input and set to 999999999999/-99999999999999

    1.3 years ago