Hi!
When I press left or right arrow, the Input.GetAxis(“Horisontal”) reach -1 or 1 value within ~1 second.
I want reach -1 or 1 value in more time, eg. 5 seconds.
How can I do this?
Thanks!
Hi!
When I press left or right arrow, the Input.GetAxis(“Horisontal”) reach -1 or 1 value within ~1 second.
I want reach -1 or 1 value in more time, eg. 5 seconds.
How can I do this?
Thanks!
Hi try this: (C#)
float value = 0;
float speed = 0.01f;
void Update () {
value += Input.GetAxis("Horizontal") * speed;
value = Mathf.Clamp(value, -1f, 1f);
}