1. Post #1
    Watercycle's Avatar
    January 2009
    85 Posts
    brain is fried tonight...

    how would i go about making a variable slowly go from 1 to say 5? ~ in a think hook

    i remember it something like: Variable += (TargetNumber - OldNumber)/Speed

  2. Post #2
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    you either want Lerp(percent, original, target) or
    variable = variable + (target - original)*delta
    Reply With Quote Edit / Delete Reply Mac United States Show Events Lua Helper Lua Helper x 1 (list)

  3. Post #3
    Map in a box's Avatar
    July 2009
    7,419 Posts
    SmoothVal = SmoothVal + (SmoothVal - RealValue) / Smoothness
    Reply With Quote Edit / Delete Reply Windows XP Professional x64 United States Show Events Lua Helper Lua Helper x 1 (list)

  4. Post #4
    Watercycle's Avatar
    January 2009
    85 Posts
    thank you very much the both of you =)

    i just found now that
    [h=1]math.Approach is easiest[/h]

  5. Post #5
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    don't give math.Approach a fixed length to go by or else it's going to be inconsistent
    Reply With Quote Edit / Delete Reply Mac United States Show Events Informative Informative x 1 (list)