- Home /
2D Animation - Animation Goes Extremely Fast
So I have been using a tutorial to do 2D Animation using sprites. This is my code so that when i hid the space button it plays the animation. The issue im having is that as soon as i hold the space bar it plays the animation extremely fast and you can barely tell anything happend. How can i slow it down?
using UnityEngine;
using System.Collections;
public class CharacterMove : MonoBehaviour {
public Animator anim;
private float forwardMovement;
private bool running;
// Use this for initialization
void Start () {
running = false;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.Space) && !running)
{
forwardMovement = 1;
running = true;
}
else
{
forwardMovement = 0;
running = false;
}
anim.SetFloat("ForwardMovement",forwardMovement);
anim.SetBool("Running",running);
}
}
Comment
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
How to change animation's speed in C#? 2 Answers
,Sprite disappeared on positive y axis 2d unity 0 Answers
Multiple Cars not working 1 Answer
Gun is not rotating while player is in a animation 0 Answers