Hi i use Unity 5, and there is no animation tutorials. I have an animation and i use the script people say that i shall use, but still doesn’t work, all i want is that my axe will swing when i press a button. Any ideas?
If you want play animation change .fbx rig to “Legacy” - easy to change just click your .fbx file in Unity3D go Rig and change to “Legacy” then scripting .
In Unity5 scripting you need to use code like this :
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Animation anim;
void Start() {
anim = GetComponent<Animation>();
}
void Update() {
if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1F)
anim.CrossFade("Run");
else
anim.CrossFade("Idle");
}
}
Most, if not all, animation tutorials should work with unity5 as it still uses the same animation system. I would follow whatever tutroials you can find, and unity5 will convert most lines of code if they use older code.