Hi,
thank you for all of your assistance, did everything like that, still couldn't get it to work, I guess I'm still to much of a newbie, anyway we sorted this out from the programmers side of view. This is the code that is working fine.
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public GameObject myPlayer = null;
private SkeletonAnimation playerAnimation = null;
// Use this for initialization
void Start () {
playerAnimation = myPlayer.GetComponent<SkeletonAnimation> ();
playerAnimation.AnimationName = "idle";
playerAnimation.loop = true;
}
// Update is called once per frame
void Update () {
if (Input.GetKey ("c")) {
playerAnimation.AnimationName = "attack";
playerAnimation.loop = false;
}
else if (Input.GetAxis ("Horizontal")==0.0f) {
playerAnimation.AnimationName = "idle";
playerAnimation.loop = true;
}
else if (Input.GetAxis ("Horizontal") != 0.0f) {
playerAnimation.AnimationName = "walk";
playerAnimation.loop = true;
}
}
}