public class Knight : MonoBehaviour {
private tk2dSpineAnimation skeleton;
void Start() {
skeleton = GetComponent<tk2dSpineAnimation>();
}
void LateUpdate() {
if (skeleton.loop) return;
if (skeleton.state.Animation != null && skeleton.state.Time >= skeleton.state.Animation.Duration - 0.25) {
skeleton.animationName = "walk";
skeleton.loop = true;
}
}
void OnMouseDown() {
skeleton.animationName = "Swipe";
skeleton.loop = false;
}
}
Hi thanks for your reply.
How do i get the skeleton field ?
I've been using the above code how could i combine the walk animation with the swipe ?
the swipe animation has no keys in the legs .
I'm aware of the principle and how it should work I've been through the run time docs but cant get anything I've tried to work so far.
does anyone have an example.
thanks