have animations i have done it before but i cant remeber how i was wondering if something could look at my code and see how i have failed
when i try to move to activate the animation it doesnt move and when i comment it out and put it back to normal it moves
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
public float Speed = 5.0f;
Animator anim;
public bool Ismoving;
// Use this for initialization
void Start () {
anim = GetComponent<Animator> ();
}
// Update is called once per frame
public void Update () {
var x = Input.GetAxis ("Horizontal") * Speed * Time.deltaTime;
var z = Input.GetAxis ("Vertical") * Speed * Time.deltaTime;
transform.Translate (x, 0, z);
Ismoving = true;
anim.SetFloat ("Speed", Speed);
if(Input.GetAxis("Horizontal") && Input.GetAxis("Vertical") == null){
Ismoving = false;
anim.SetFloat ("Speed", 0);
}
}
}