Moving Platforms in GameMaker | Jump-Through / One-Way Platforms

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 60

  • @kibegamimultimedia
    @kibegamimultimedia 10 місяців тому +2

    Matharoo, bless you for making these tutorials and hope you keep up making more to teach us :)

  • @HardCraftMovies
    @HardCraftMovies 3 роки тому +1

    Nice one, this is something I was looking for, most tutorials on this are out of date. Thank you!

  • @aton602
    @aton602 3 роки тому +2

    This is a great tutorial that solved a problem I've had for years. Thank you!

  • @magusss2007
    @magusss2007 3 роки тому +1

    I will adapt the one way jumping to my collision for top ladder blocks, this is awesome, thanks bro.

  • @u_nobre
    @u_nobre 3 роки тому

    Thanks teacher, I found a lot of tutorials explaining ho to do this but they were pretty unrelated and weren't easy to implement, very good explication !

  • @Thenesrookie
    @Thenesrookie 2 роки тому +2

    Excellent tutorial! I was wondering if you'd ever make a tutorial on platforms that crumble/destroy after you stand on it for too long, and death pits where if you touch/fall into them it resets the level?

  • @quae6843
    @quae6843 2 роки тому +1

    For unknow reason the code didn't work when I wrote it myself (made the exact copy of your), BUT when I just pasted the code from GitHub, it started to work. What kind of magic is this?
    Anyway, good work!

  • @madnessobserver
    @madnessobserver 2 роки тому +8

    There's an issue I found with vertical moving platforms with your code, and that is that is that if the player or the platform aren't moving at an integer speed, there's a chance that the subpixel position of the player or platform will make it so the collision won't register at all, making the player fall through it.
    I haven't found a way to fix this outside of restricting both of them (player's vertical position and the platform's speed) to an integer value, which is obviously less than ideal, and since your GML skills are obviously beyond mine, do you know how to fix this issue?

    • @aton602
      @aton602 2 роки тому +1

      Same problem here , I can't se this issue too.

    • @T4R1N
      @T4R1N Рік тому +5

      For those that are looking for answers, you can fix this by rounding `bbox_bottom` in the collision checking selection. this would look like `round(bbox_bottom)

    • @FrankaifulS
      @FrankaifulS Рік тому +1

      @@T4R1N Thanks!!

  • @escarabajomayih
    @escarabajomayih 11 місяців тому

    thanks, simple and easy. perfect.

  • @Confl1ctWasHere
    @Confl1ctWasHere 3 місяці тому

    Great tutorial but I've got one problem. The game is looking for the definition of _movingPlatform, but it can't find it.

  • @memine5595
    @memine5595 3 роки тому +2

    Nice I will have to take a look Thanks. Question do you also plan to make circle based moving platforms and path following platforms in your tutorial series ?

    • @GameMakerStation
      @GameMakerStation  3 роки тому +1

      Sorry, this tutorial is not part of a series so sadly I won't be expanding on it, at least any time soon.

  • @etherealandrew5838
    @etherealandrew5838 15 днів тому

    The tutorial is helpful, but the code doesn't work. When I add it to my platform, the begin step code runs perfectly fine, but the end step throws and error for startX, startY, endX, endY and says that "they aren't defined". No idea how to fix this as I'm new to gamemaker. Any solutions?

    • @Anthony-sm8wy
      @Anthony-sm8wy 3 дні тому

      replying because I'm having the same problem. My player sprite also sinks through the platform. Are these problems related?

  • @ArtMakerAML
    @ArtMakerAML 3 роки тому +1

    you are the best!

  • @ImAlexander_YT
    @ImAlexander_YT 3 роки тому +1

    I got the code right, and so far the platforms were moving but when I did the add velocity section my game keeps crashing saying the issue is both lines of code for velocity

  • @nibiruimagineering
    @nibiruimagineering 3 роки тому

    Beautiful! Thank you.

  • @aaronwise1089
    @aaronwise1089 5 місяців тому

    or you can use paths for movement

  • @darkchocolateakasexymadafa5931
    @darkchocolateakasexymadafa5931 2 роки тому

    my platform moves nicely but if it hits the start point it doesnt move back, if it hits the ending point it moves back. Help?

  • @alessandromilkearce3304
    @alessandromilkearce3304 3 роки тому

    i have a problem with this metod. I keep Falling Down When i hit the corners

  • @resproject1731
    @resproject1731 9 місяців тому

    Thanks for your video!

  • @randomboy2004
    @randomboy2004 3 роки тому +2

    hey Gamemaker
    i was wondering could you make an "nearly infinite" terrain generation for my 2d topdown survival project
    cause making width and height 10000 in room is the worst idea ever

  • @KarlJAisthegoat
    @KarlJAisthegoat Рік тому

    I just Got an errormessage and i dont understand it

  • @aulasdematematicaefisica
    @aulasdematematicaefisica 3 роки тому

    Why didn't you use: if (alarm[0] == -1) alarm[0] = waitTime; in 4:15 ?

    • @GameMakerStation
      @GameMakerStation  3 роки тому +1

      There's no need for it, since the goingToStart boolean is flipped and that statement won't be called again until it reaches another point.

    • @aulasdematematicaefisica
      @aulasdematematicaefisica 3 роки тому

      @@GameMakerStation Thanks :)

  • @soulguardian6893
    @soulguardian6893 10 місяців тому

    for the collision with the player with the platform, the player just falls through it and im not sure what the issue is

    • @bubbles5195
      @bubbles5195 9 місяців тому

      I have the same issue as you. Did you end up figuring this out?

    • @soulguardian6893
      @soulguardian6893 9 місяців тому +1

      @@bubbles5195 unfortunately i didn't, unless you get a response then id do a different tutorial

    • @kurodyne9692
      @kurodyne9692 8 місяців тому

      @@soulguardian6893 You might be overshooting the collision during the pixel-perfect corrections, check and make sure it's not over-correcting. Use breakpoints!

    • @kurodyne9692
      @kurodyne9692 8 місяців тому

      @@bubbles5195 Check my other comment in this thread

  • @imnugget8085
    @imnugget8085 Рік тому

    I have no clue why this doesn't work try 3 times fresh no error code just doesn't let me land nor does it move

  • @saidnep_5433
    @saidnep_5433 3 роки тому +1

    Hey there, I see you haven't uploaded anything in a while, is everything alright?

  • @riemerdijkstra5974
    @riemerdijkstra5974 3 роки тому

    great tutorial. just one question
    why did you add "max(1, moveY)" to the instance_place function instead of just "moveY"?
    it seems a bit unnecessary considering that you already check the boundary boxes in the next line

    • @GameMakerStation
      @GameMakerStation  3 роки тому

      That's so it always checks at least 1 pixel down even when moveY is 0 or negative.

  • @celesteorsa3918
    @celesteorsa3918 3 роки тому +1

    Sorry matharoo, but I noticed that you cannot rename another instance with the same name ("platform1"), even if it is in two different rooms.
    So this implies that I have to give a unique name to each instance for each room, correct me if I'm wrong ...

    • @GameMakerStation
      @GameMakerStation  3 роки тому +1

      Yup! Instance names have to be unique throughout your project.

  • @ConquerorBen
    @ConquerorBen 3 роки тому

    Thanks so much for the simple solution! Would you be willing to elaborate on implementing this in a way where the platforms have collision from all 4 sides (and thus push the player around)? I've been experimenting with the code, but have several challenges with it working as I'd like.

    • @GameMakerStation
      @GameMakerStation  3 роки тому

      That sounds like a tough problem. I recommend joining the Discord server given in the desc., you can ask there :)

  • @pyxelpub8251
    @pyxelpub8251 3 роки тому

    I've been trying to have the character jump down through the platform when pressing down, but I can't seem to get the code to work, any advice?
    I basically try to make the mask_index = -1, but it doesn't seem to work for some reason.
    Thanks Matharoo!

    • @letai511
      @letai511 3 роки тому +1

      just check if key_down && on-the-moving-platform then y += 1 should work

  • @FutureDragon
    @FutureDragon 3 роки тому

    can you please do a tutorial for character movement

    • @GameMakerStation
      @GameMakerStation  3 роки тому

      Here you go :) ua-cam.com/video/3xaHvRQ2p7Q/v-deo.html

  • @РасильИбрагимов-р4т

    Awesome.

  • @yours576
    @yours576 8 місяців тому

    when the platform stops i fall through it

  • @owltoe0164
    @owltoe0164 2 роки тому

    As soon as a platform moves vertically, I fall through the floor

  • @no_name4247
    @no_name4247 3 роки тому +1

    *Write game server*

  • @gaming_universe456
    @gaming_universe456 2 роки тому

    When you can (and if you can), can you help me? I keep getting an error even though I did the same thing you did. I tried to start my game at 5:20 in the video.
    (obj_jumpthroughmovement_collision is the platform moving)
    Error Code:
    ___________________________________________
    ############################################################################################
    ERROR in
    action number 1
    of Step Event1
    for object obj_jumpthroughmovement_collision:
    Variable obj_jumpthroughmovement_collision.endX(100011, -2147483648) not set before reading it.
    at gml_Object_obj_jumpthroughmovement_collision_Step_1 (line 3) - var _targetX = endX, _targetY = endY;
    ############################################################################################
    gml_Object_obj_jumpthroughmovement_collision_Step_1 (line 3)

    • @MrJonesArt
      @MrJonesArt Рік тому

      I have the same issue - problems seems to be that the moving platform has no local variable for endX,y or startX,Y. It depends on the 2 points to set them, which isn't happening for me either and causes the same crash.

    • @devonmasters7794
      @devonmasters7794 Рік тому

      Did you ever figure out how to fix this? I'm having the same issue too.