A
Alsis World
Guest
when ever i jump and land on the ground the player character shakes for a second while touching the ground, here's my entire code if it's not in gravity or y collision:
////Movement
///Horisontal movement
move = keyboard_check(ord("D")) - keyboard_check(ord("A"));
hsp = move * movespeed;
x = x + hsp;
///Vertical movement
if (keyboard_check(vk_space)){
vsp = jumpspeed;
}
///Collision
//X Collision
if (place_meeting(x + hsp, y, obj_neutral_ground)){
x = x + sign(-hsp)
hsp = 0
}
//Y Collision
if (place_meeting(x, y + vsp, obj_neutral_ground)){
y = y + sign(-vsp);
vsp = 0;
}
///Gravity
if (vsp < 5 and not place_meeting(x, y + 1, obj_neutral_ground)){
vsp = vsp + grav;
}
y = y + vsp;
////Movement
///Horisontal movement
move = keyboard_check(ord("D")) - keyboard_check(ord("A"));
hsp = move * movespeed;
x = x + hsp;
///Vertical movement
if (keyboard_check(vk_space)){
vsp = jumpspeed;
}
///Collision
//X Collision
if (place_meeting(x + hsp, y, obj_neutral_ground)){
x = x + sign(-hsp)
hsp = 0
}
//Y Collision
if (place_meeting(x, y + vsp, obj_neutral_ground)){
y = y + sign(-vsp);
vsp = 0;
}
///Gravity
if (vsp < 5 and not place_meeting(x, y + 1, obj_neutral_ground)){
vsp = vsp + grav;
}
y = y + vsp;