Hi, I am relatively new to these forums ( my 2nd or 3rd post) so please excuse me if this is not the right place to put this.
I am sort of new to Unity (only 3 months) but can understand some of the logic that goes into coding (previouse experience was Gamemaker). I am trying to use orthello 2d for a 2d game I am creating with a group of my friends (who are basically the artists so they cannot help me code). I have recently run into a problem with orthello when trying to get the character to walk. The character does move but after setting up orthello it only animates the first frame of the walking animation.
After reading some of the documentation I have learned that the reason for that happening is because since it is placed in the update function everytime I press the left arrow key it would constantly reset the animation to the first frame.
My question is how can I still get it to animate while I move and stop when the character stops?
Here is part of the code (only shows the idleRight and walkRight):
private var mySprite : OTAnimatingSprite;
function Start(){
mySprite = GetComponent("OTAnimatingSprite");
}
function Update () {
/*************ANIMATION*************/
velocity = Vector3(Input.GetAxis("Horizontal"),0,0);
if (velocity.x==0 moveDirection2 == 1) //idle right
{
mySprite.Play("idleRight");
}
if (velocity.x>0) //walk Right
{
velocity*=walkSpeed;
mySprite.Play("walkRight");
}
If there is any more questions please ask.