hello guys, how to make my animations playing with current position,i have 2 animation,the 1st one is right move and 2nd one is left move…this is my code…
`var rotationSpeed : float = 100.0;
function Update () {
//get horizontal
var translation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
translation *= Time.deltaTime;
//decrease speed of animation play
for (var state : AnimationState in animation)
{
state.speed = 0.1;
}
//move to the right
if(translation > 0.2)
{
animation.CrossFade("run");
}
else
{
animation.CrossFade("idle");
}
//move to the left
if(translation < -0.2)
{
animation.CrossFade("run_left");
}
else
{
animation.CrossFade("idle");
}
}`
when i pressing ‘a’ and ‘d’ button its going well, the problem is,when i change my animation movement, it is not play at current location which is the last position before new animation playing…what i want is when change to the new movement, it play at current position,not at the original position of animation…for the animation i’m using ex2d extension to create it…can anyone help me?? if you don’t understand please tell me,