How to make jump animation in Game Maker?
<p>for some reason when I run the game the sprite is in its jump animation and not its idle at the start even when moving left and right the sprite is still the jump animation. i followed a tutorial on youtube i know that the right and left animations work any help would be appreciated thanks.</p>

<pre><code>///platform "physics"

var rkey = keyboard_check(vk_right);
var lkey = keyboard_check(vk_left);
var jkey = keyboard_check_pressed(vk_up);

//Check for ground
if (place_meeting(x, y+1, obj_solid))
{
airjump = 1;
vspd = 0;
//Jumping
if (jkey)
  {
    vspd = -jspd;
  }
}
else
{
//Gravity
if (vspd &lt; 10 )
{
 vspd += grav;
}    
//Check For airjump
if(airjump &gt; 0)
{
    if(jkey)
    {
    vspd = -jspd;
    airjump -= 1;        
    }
}
}

//Moving Right
if(rkey)
{
hspd = spd;
//Left Wall-Jump
if(place_meeting(x-1, y, obj_solid) &amp;&amp; !place_meeting(x, y+1, obj_solid)
&amp;&amp;              !lkey)
{
    vspd = -jspd;
}
}
//Moving Left
if(lkey)
{
hspd = -spd;
//Right Wall-Jump
if(place_meeting(x+1, y, obj_solid) &amp;&amp; !place_meeting(x, y+1, obj_solid) 
&amp;&amp;       !rkey)
{
    vspd = -jspd;
}
}
//Check for not moving
if((!rkey &amp;&amp; !lkey) || (rkey &amp; lkey))
{
hspd = 0 ;
}
//Horizontal Collisions
if(place_meeting(x + hspd, y, obj_solid))
{
while(!place_meeting(x+sign(hspd), y,obj_solid))
{
    x += sign(hspd);
}
hspd = 0;
}

//Move Horizontally
x += hspd;

//Vertical Collisions
if(place_meeting(x, y+vspd, obj_solid))
{
while(!place_meeting(x, y+sign(vspd),obj_solid))
{
    y += sign(vspd);
}
vspd = 0;
}

//Move Vertically
y += vspd;

//Control The Sprites
if(vspd != 0)
{
sprite_index = spr_player_jump;
image_speed = 1;
//use the next line if you have a falling animation as well but the 
falling         animation should be the second one
//image_index = y&gt;yprevious;
}

else
{

if(hspd != 0)
{
    sprite_index = spr_player_walk;
    image_speed = .15;
}
else if(hspd = 0)
{
    sprite_index = spr_player_stand;
}
}
if (!place_meeting(x,y+1, obj_solid))
{
sprite_index=spr_player_jump;
}

//Control the direction that the player is facing
if(hspd &gt; 0)
{
image_xscale = 1;    
}
else if (hspd &lt; 0)
{
image_xscale = -1;
} 
</code></pre>