Answers for "How to smooth between values?"
http://answers.unity.com/questions/274098/how-to-smooth-between-values.html
The latest answers for the question "How to smooth between values?"Answer by Tim-Michels
http://answers.unity.com/answers/274105/view.html
You should use math functions, depending on the kind of effect you want.
I often use ***Mathf.Lerp(minVal,maxVal, progress);***
The 'progress' parameter is most important here.
You have to calculate the progress through a mathematical function, I'll give you an example for a simple smoothed progress.
Just use ***progress = Mathf.Sin(timeProgress);***
Timeprogress is a regular counter, but the 'progress' value will be smoothed.
Just use that value inside your Lerp and you should have a good effect. There are also other math functions, but this one is certainly usefull.
CheersMon, 25 Jun 2012 14:06:36 GMTTim-MichelsAnswer by Setzer22
http://answers.unity.com/answers/274103/view.html
Unity has this implemented already.
The Mathf.SmoothDamp() method seems to be what you're looking for. It gradually smooths a value over time, that value can only be a float though, so if you want to smooth a vector3, you'll have to do it with all of its 3 components. Check this: http://unity3d.com/support/documentation/ScriptReference/Mathf.SmoothDamp.html
Also I've seen a class called AnimationCurve from the unityEngine, I don't know yet how it works, but seems to be another way to smooth between values using a custom smooth curve.
Also, you may use lerp, but you must take into account that lerp is a linear interpolation (not smoothed). Vector3 can be "lerped" with Vector3.Lerp, no need to do it for all of its 3 components, but as I said, this is not a smoothed translation, just a linear one.
Hope it helped.Mon, 25 Jun 2012 14:04:03 GMTSetzer22