Hello,
I have been trying to get my character to move using the mechanim tutorial modified for what I need and sadly my model simply does not move. I made it in Softimage and even in the tutorial he hardly ever moves but when I try to code motion on my own they just sit there and do the animation but refuse to budge. What am I doing wrong? Is there any way to fix this or will I just have to avoid mechanim?
#pragma strict
@script RequireComponent(Animator)
@script RequireComponent(CapsuleCollider)
@script RequireComponent(Rigidbody)
public var v : float = 0.00;
public var h : float = 0.00;
private var anim : Animator;
private var col : CapsuleCollider;
public var animSpeed : float = 1.5;
function Start () {
anim = GetComponent(Animator);
col = GetComponent(CapsuleCollider);
}
function FixedUpdate () {
v = (Input.GetAxis("Vertical"));
h = (Input.GetAxis("Horizontal"));
anim.SetFloat("Speed", v);
anim.SetFloat("Direction", h);
anim.speed = animSpeed;
}
Here is my code, I tried translating the c# into javascript. Please help T^T