Mathf.SmoothStep Manual     Reference     Scripting  
Scripting > Runtime Classes > Mathf
Mathf.SmoothStep

static function SmoothStep (from : float, to : float, t : float) : float

Description

Interpolates between min and max and eases in and out at the limits.

JavaScripts
var minimum = 10.0;
var maximum = 20.0;

function Update() {
transform.position = Vector3(Mathf.SmoothStep(minimum, maximum, Time.time), 0, 0);
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
public float minimum = 10.0F;
public float maximum = 20.0F;
void Update() {
transform.position = new Vector3(Mathf.SmoothStep(minimum, maximum, Time.time), 0, 0);
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

public minimum as single = 10.0F

public maximum as single = 20.0F

def Update():
transform.position = Vector3(Mathf.SmoothStep(minimum, maximum, Time.time), 0, 0)