T
temmieflakes42
Guest
ive managed to achieve vertical and horizontal motion in moving platforms, however there is an issue with the vertical platform (and with the horizontal platform, but it's less consequential than the vertical one)
neither of the platforms carry the player along
you have to walk along them and move with them to get across
this is a problem with the vertical platform, because you can't move up in time, so it passes through you, causing you to get stuck and then dropping you below.
both of my platforms are running on paths in case that's important, because it was the easiest method i could figure out to get them to move.
i just want to know how to get them to carry the player along. both of them are children of my parent wall object, "obj_wall" which has this collision code coded into the "step" event of my player object:
neither of the platforms carry the player along
you have to walk along them and move with them to get across
this is a problem with the vertical platform, because you can't move up in time, so it passes through you, causing you to get stuck and then dropping you below.
both of my platforms are running on paths in case that's important, because it was the easiest method i could figure out to get them to move.
i just want to know how to get them to carry the player along. both of them are children of my parent wall object, "obj_wall" which has this collision code coded into the "step" event of my player object:
Code:
//Horizontal Collision
if (place_meeting(x+hsp,y,obj_wall))
{
while(!place_meeting(x+sign(hsp),y,obj_wall))
{
x += sign(hsp);
}
hsp = 0;
}
x += hsp;
//Vertical Collision
if (place_meeting(x,y+vsp,obj_wall))
{
while(!place_meeting(x,y+sign(vsp),obj_wall))
{
y += sign(vsp);
}
vsp = 0;