animation troubles (Preferably give me the answer in drag-and-drop, but I would take straight in GML code too)

having big problems getting my sprite animation to play at all. I have followed this tutorial:
And driving myself crazy because is not working. this code is here:
function animation()
{
if(on_ground == true)
{
if(!(hsp == 0))
{
sprites_in = PC_TRL_IdleF;

if(hsp > 0)
{
Faceing = 1;
}

else
{
Faceing = -1;
}
}

else
{
sprites = Spr_run;
}
}

else
{
sprite_index = Spr_jump_start;
}
}


note the facing part working but not this script but read input script but then It doesn't flip to character on the spot instead flip around as if he was on a turntable and stops the sprite animation from playing altogether being on the 1st frame of animation.
Made all the sprites into each separate object. Using the parent-child relationship and tieing each of them as separate valuables on the main object. Said values will be listed here:
name - default
Spr_idle - PC_TRL_IdleF
Spr_jump_start - PC_TRL_Run
Spr_walk - PC_TRL_Walk
Spr_jump_mid - PC_TRL_Jump2_Mid
Spr_jump_down - PC_TRL_Jump3_down
Spr_jump_land - PC_TRL_Jump4_Land
Spr_Para_deploy - PC_TRL_Para_Deploy
Spr_Para_drop - PC_TRL_Para_Drop
A screenshot of the names of the objects and the names of the sprites will be posted

here are the relevant scripts:
function Read_Input()
{
hop = false;

var l4C08B02D_0;
l4C08B02D_0 = keyboard_check(ord("D"));
if (l4C08B02D_0)
{
hsp = run_Spd;
}

var l5D726ADD_0;
l5D726ADD_0 = keyboard_check(ord("A"));
if (l5D726ADD_0)
{
hsp = -run_Spd;
}

var l5014C19B_0;
l5014C19B_0 = keyboard_check(vk_right);
if (l5014C19B_0)
{
hsp = Walk_Spd;
}

var l4B81B1E8_0;
l4B81B1E8_0 = keyboard_check(vk_left);
if (l4B81B1E8_0)
{
hsp = -Walk_Spd;
}

var l0C14AB4D_0;
l0C14AB4D_0 = keyboard_check_pressed(vk_space);
if (l0C14AB4D_0)
{
hop = true;
}



hsp = hsp*drag;

x += hsp;

if(!(hsp == 0))
{
if(hsp > 0)
{
Faceing = 1;
}

else
{
Faceing = -1;
}
}
}
// // Script assets have changed for v2.3.0 see
// // https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information
function check_jump()
{
if(on_ground == true)
{
if(hop == true)
{
vsp = -jump_spd;

if(abs(hsp) == 0)
{

}
}
}
}

function Check_ground()
{
var l31E1FA44_0 = instance_place(x + 0, y + global.grav, O_solid);
if ((l31E1FA44_0 > 0))
{
on_ground = true;
}

else
{
on_ground = false;
}
}
function Read_Input()
{
hop = false;

var l4C08B02D_0;
l4C08B02D_0 = keyboard_check(ord("D"));
if (l4C08B02D_0)
{
hsp = run_Spd;
}

var l5D726ADD_0;
l5D726ADD_0 = keyboard_check(ord("A"));
if (l5D726ADD_0)
{
hsp = -run_Spd;
}

var l5014C19B_0;
l5014C19B_0 = keyboard_check(vk_right);
if (l5014C19B_0)
{
hsp = Walk_Spd;
}

var l4B81B1E8_0;
l4B81B1E8_0 = keyboard_check(vk_left);
if (l4B81B1E8_0)
{
hsp = -Walk_Spd;
}

var l0C14AB4D_0;
l0C14AB4D_0 = keyboard_check_pressed(vk_space);
if (l0C14AB4D_0)
{
hop = true;
}



hsp = hsp*drag;

x += hsp;

if(!(hsp == 0))
{
if(hsp > 0)
{
Faceing = 1;
}

else
{
Faceing = -1;
}
}
}

and var will be in another screenshot

If anybody can see where I screwed up or just have a simple, more reliable achieving the exact same thing? Please let me know!!! As stated above will perform my answers being drag-and-drop but if you get to straight GML code as long as it can work reliably and be preferably easy to implement, I will be a happy man. (i just posted in GML coding like that because it makes it easier to post that way.)
PS: I might post this and delete it later because I'm scared since I'm posting this so late at night, I'm not gonna get any good replies if any at all
 

Attachments

Last edited:
Top