Moving Platforms Issue [Help needed]

Trex0n

Member
https://maddythorson.medium.com/celeste-and-towerfall-physics-d24bd2ae0fc5 So I've implemented moving platforms into my game, modeled after this article, and for the most part they work as I expect them to. However, sometimes when I land on them it seems to push/teleport me out of it. The following video might be a bit more helpful in describing the issue. Its a really short clip and it happens fast so I understand if it's a little confusing. Any help is appreciated though! :)

GML:
function ColliderMove(_xAmount,_yAmount) {
    ///Variables
    Remainder.x += _xAmount;
    Remainder.y += _yAmount;
    var _xMove = round(Remainder.x);
    var _yMove = round(Remainder.y);

    ///Apply Movement
    if (_xMove != 0 || _yMove != 0) {
        ///Disable Collision
        Collidable = false;
    
        ///Create Riding Actors List
        iListActor = ds_list_create();
        ds_list_clear(iListActor);
        
        with (pActor) {
            if(IsRiding(other.id)) ds_list_add(other.iListActor,id);
        }
    
        ///Horizontal Movement
        if (_xMove != 0) {
            Remainder.x -= _xMove;
            x += _xMove;
        
            if (_xMove > 0) {
                with (pActor) {
                    if (place_meeting(x,y,other.id)) {
                        xMove(other.bbox_right - bbox_left + sign(_xMove),Squish);
                    } else if (ds_list_find_index(other.iListActor,id) != -1) {
                        xMove(_xMove);
                    }
                }
            } else {
                with (pActor) {
                    if (place_meeting(x,y,other.id)) {
                        xMove(other.bbox_left - bbox_right + sign(_xMove),Squish);
                    } else if (ds_list_find_index(other.iListActor,id) != -1) {
                        xMove(_xMove);
                    }
                }
            }
        }
        
        ///Vertical Movement
        if (_yMove != 0) {
            Remainder.y -= _yMove;
            y += _yMove;
        
            if (_yMove > 0) {
                with (pActor) {
                    if (place_meeting(x,y,other.id)) {
                        yMove(other.bbox_bottom - bbox_top + sign(_yMove),Squish);
                    } else if (ds_list_find_index(other.iListActor,id) != -1) {
                        yMove(_yMove);
                    }
                }
            } else {
                with (pActor) {
                    if (place_meeting(x,y,other.id)) {
                        yMove(other.bbox_top - bbox_bottom + sign(_yMove),Squish);
                    } else if (ds_list_find_index(other.iListActor,id) != -1) {
                        yMove(_yMove);
                    }
                }
            }
        }
    
        ///Enable Collision
        Collidable = true;
    
        ///Destroy List
        ds_list_destroy(iListActor);
    }
}
 
Hey! Did you ever get this fixed? I've been trying to add these kinds of solid platforms to my game for a long time. I'm a beginner coder so reading the article from Maddy and looking at your code, some of it is over my head. I'd be really interested in seeing how you accomplished this overall (ie: what the actor code looks like and in which steps/order you're executing this in).
 
Top