How to use mathf.smoothdamp properly

I want to change a color with smoothdamp but I dont know what I should put in the ‘ref velocity’ field. I put a ‘ref space float’ but it would still give an error. I can successfully do this procedure with lerp but someone mentioned smoothdamp is less hectic.

“The current velocity, this value is
modified by the function every time
you call it.”

As you can see in the example you just have to put a variable that can be accessed by the method and that won’t be reset after the function was executed.

Example : (though there is one in the doc)

private float smoothedValue = 0.0f;
private float velocity = 0.0F;
void Update() 
{
    smoothedValue = Mathf.SmoothDamp(smoothedValue , 100, ref velocity, 10);
    Debug.Log(smoothedValue);
} 

Here the variable “smoothedValue” will go from 0 to 100 in approximately 10 seconds


Not trying to be rude but you should read the documentation before asking questions here, and it’ll save you a lot of time.