conman06
Member
Okay, so I'm trying to program the player's vertical collision. My problem is that the player hovers over the ground, yet it says that it is on the floor. I can assure you that it is not a hitbox problem. Below is the code for vertical collision.
I've attached a photo of what the player looks like in the game. (ignore the variables, they're there to help me identify the problem.)
I've been trying to fix the problem for the past few days, so I hope you can help identify the problem and help me fix it.
GML:
//Gravity
if (!place_meeting(x,bbox_bottom + vsp,oWall)) {
vsp = clamp(vsp,-10,15)
grounded = false
} else {
//Actually falling
if (sign(vsp) < 0) {
//Slowfall to adjust position
if (!place_meeting(x,bbox_bottom + vsp,oWall)) vsp = vsp;
else vsp = 0;
vsp = 0;
grounded = true
bonus_jumps = max_jumps
hold_jump = false;
}
}
I've been trying to fix the problem for the past few days, so I hope you can help identify the problem and help me fix it.