Slope inconsistency

VerdeBoss

Member
So I'm having a little problem about my slope inheritance code where players y position will follow through the assigned formula from each slope instances it collides on
When the player follows through the terrain, player will get interrupted by issues such as "jumping five pixels up" upon touching a new slope instance as demonstrated by the gif.

This is all the code that operates the collision
GML:
//check for any slope instance
var slope = collision_rectangle(x-2, bbox_bottom-5, x+2, bbox_bottom+6, par_slope, 1, 0);

if (vspeed >= 0) {

    if (slope) {

        //set players y position
        y = x - slope.x;
        //code isn't fully shown as its not part of the issue, but its how it essentially works, if you really need it, tell me.
    }
}
Is there any better way to fix this issue?

Thanks in advance.
 

Attachments

Top