When I first try to make the object stand on a platform, I assume that I must use the move_bounce functions to make the player object stand on the platform object but instead it fell through the platform so that code didn't work for this situation. So, I had to use move_outside functions in order to make it worked. The move_bounce functions is used to make the object bounce off another object(or walls) so that the object can't go through the walls.
Now, for the move_outside functions.
move_outside_solid(dir,maxdist) Moves the instance in the direction until it no longer lies within a solid object. If there is no collision at the current position the instance is not moved. You can specify the maximal distance to move (use a negative number for an arbitrary distance).
move_outside_all(dir,maxdist) Same as the previous function but this time you move until outside any object, not just solid objects.
This action moves the instance in the desired direction until it a couple of pixels away from the solid object. The user can specify what maximal distance to move in pixels. (Use a negative number for an arbitrary distance).
Here is the code I used for making the object stand on a platform:
vspeed=0
{
move_outside_solid(90,-2)
}
vspeed in the code above is used to allow the object to stand above the platform. The vspeed can also be used to move the object vertically.
Now, for the move_outside functions.
move_outside_solid(dir,maxdist) Moves the instance in the direction until it no longer lies within a solid object. If there is no collision at the current position the instance is not moved. You can specify the maximal distance to move (use a negative number for an arbitrary distance).
move_outside_all(dir,maxdist) Same as the previous function but this time you move until outside any object, not just solid objects.
This action moves the instance in the desired direction until it a couple of pixels away from the solid object. The user can specify what maximal distance to move in pixels. (Use a negative number for an arbitrary distance).
Here is the code I used for making the object stand on a platform:
vspeed=0
{
move_outside_solid(90,-2)
}
vspeed in the code above is used to allow the object to stand above the platform. The vspeed can also be used to move the object vertically.