using System.Collections; using System.Collections.Generic; using UnityEngine; public class AniSpeed : MonoBehaviour { Animator anim; private float aspeed = 0.0f; // Use this for initialization void Start () { anim = GetComponent(); anim.speed = aspeed; } // Update is called once per frame void Update () { if(Input.GetKeyDown("up")) { aspeed += 0.2f; } //anim.speed = 0.5f; if (aspeed > 0.01f) aspeed -= 0.01f; anim.speed = aspeed; Debug.Log(aspeed.ToString()); } }