How to play multiple animations on the same game object.

I am creating a 3d endless runner game. Currently my game object contains two further child (Rider and the horse). The component (Animation)is attached to rider only and in the animator component play automatic is enabled. Now the problem is that its default animation is “horse_galloping” which is working fine. whenever i press “space” key jump animation plays once but the previous animation “horse_galloping” stops working, although the loop is enabled but still its not working after hitting space key. What i want is to keep playing animation “horse_galloping” after the “horse_jump” animation is played.
Following is my code::

private Animation anim;

void start()
anim = mygamebobject.GetComponent ();


update ()


if (Input.GetKeyDown (“space”))




try to connect horse_galloping animation to horse_jump in animator it come back to horse_galloping animation after the horse_jump animation complete.

My first recommendation would be for you to change to Mecanim animation if possible.
But if you intend to use Legacy I think this would help you : Unity - Manual: Animation Scripting (Legacy)

You can “play” with the weight of the animations. That means, an animation with higher weight would not be “cut” by an animation with a lower one. You just have to set the weight of your jump animation higher than the galloping animation and then, the galloping won’t crossfade until the jump animation is over.

Hope I made my point, I’ve an example code but can’t get to it right now. If you need it tell me and I’ll post it when I get home.