• Starting today August 7th, 2024, in order to post in the Married Couples, Courting Couples, or Singles forums, you will not be allowed to post if you have your Marital status designated as private. Announcements will be made in the respective forums as well but please note that if yours is currently listed as Private, you will need to submit a ticket in the Support Area to have yours changed.

How To Make An Object Stand On A Platform?

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.

Blog entry information

Author
LinkxPeach
Read time
1 min read
Views
237
Last update

More entries in Old Blog Software

More entries from LinkxPeach

Share this entry