get input slowly.

i have Var Input; which changes to 1 when i click right arrow and to -1 when i click left arrow, So it changes immediately when i click it and i want to change it from 0 to 1 (or -1) during for example 3 seconds. pls help…

Can you provide a better explanation? An example of how you're currently doing this? I think you might be trying to click and hold a button to slowly move it towards 1 or -1.

i have a car and when i click to right arrow and left arrow SteerInput changes immediately and i want it to change time. thats all

Instead of using Input.GetButton("left")and Input.GetButton("right"), use Input.GetAxis("Horizontal"). Look at HannesR's answer if you want to tweak values like: sensitivity, gravity etc.

2 Answers

2

In InputManager (Edit / Project Settings / Input) you can tweak values such as gravity and sensitivity for that effect.

Or [SmoothDamp][1]. =) [1]: http://docs.unity3d.com/Documentation/ScriptReference/Mathf.SmoothDamp.html