It there anyway to move float smoothly from 0 to 1

Hi,

I’m doing car game racing now mobile control UI and i use buttons in UI
when i click UI button to move wheel right or left rotate faster and not smoothly turn.

code im using basic
I tried to make * Time.deltaTime not works too
I need when click UI change the float value to 1 or -1 smoothly and not fast

thanks for any replay

public float SteeringInput;

public void steerleft()
{
	SteeringInput = -1f;
}

public void steerup()
{
	SteeringInput = 0f;
}

public void steerright()
{
	SteeringInput = 1f;
}

You may use Mathf.Lerp to make a smooth transition (interpolate) between two values. Try the example code in the documentation to learn how it works.

Other similar methods to interpolate smoothly between values are:
Mathf.MoveTowards
Mathf.SmoothDamp
Mathf.SmoothStep

Check out the Mathf class in the scripting API for other useful methods.