Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make a platform move left and right constantly

i want a platform that simply moves left and right which my player can hop on and and move with it. It also shouldn't affect my players speed since i want it as if the player was still on the floor not moving. Any help would be appreciated. Thanks!


  • bob loblawbob loblaw Posts: 380Member, PRO

    look up jamie cross on your web browser. he has a series of good easy to follow video tutes that go through platformer movement, and i am pretty sure there’s l/r movement in there.

  • mypingo7mypingo7 Posts: 22Member


  • bob loblawbob loblaw Posts: 380Member, PRO

    @mypingo7 said:

    no problem. the basic concept is within the moving platform have a change attribute at the start to set the linear velocity x to whatever speed you want to move (- speed if moving left to start). then have two rules that say:
    if attribute self position x < or = the left x coord at the end of the platform’s move, change self linear velocity x to whatever speed then
    second rule, if self position x > or = the right end, change self linear velocity x to - the speed.

    hope that and jamie’s videos help.

    if you are fairly new to gs, i’d recommend jamie’s videos, and the ones by gshelper on youtube to get your head around a lot of the gs functionality.

  • Twayne2Twayne2 Posts: 401Member, PRO

    But also make the platform have tons of density, so the player can collide but not move it.

  • jamie_cjamie_c Posts: 5,551Member

    This might be a little late but here is the tutorial I did on this subject:

  • Twayne2Twayne2 Posts: 401Member, PRO
    edited September 2018

    Looks good @jamie_c. One question though. If the player touches the side of the elevator, or actually underneath the elevator, I would presume he would "teleport" up a few pixels or more. Of course you could add constains for the x axis as well, but that would not solve the underneath the elevator dilemma right?

  • Twayne2Twayne2 Posts: 401Member, PRO

    O actually watched that a long while ago I think when I started Gamesalad. Your videos helped me tremendously with my logic of Gamesalad and also general guidelines. Thanks. :grin:

Sign In or Register to comment.