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!

Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    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 Member Posts: 22

    ty

  • bob loblawbob loblaw Member, PRO Posts: 793

    @mypingo7 said:
    ty

    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 Member Posts: 458

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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

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

  • Twayne2Twayne2 Member Posts: 458
    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 Member Posts: 458

    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.