GameMaker Studio 2 Tutorial - Simple Character Movement (L, R, U, & D)

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

КОМЕНТАРІ • 129

  • @copiousgarlicbread
    @copiousgarlicbread 5 років тому +8

    sir thank you your a lifesaver, i didnt even watch the whole video and i have already gotten farther then i could have if i worked by myself with no tutorials. Thank you for this. im making an undertale-like RPG.

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

      ye me too making undertale fan game
      ^v^

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

      same >

  • @WannabeComposer64
    @WannabeComposer64 6 років тому +16

    You saved me so much time! Strait to what I need to hear!

  • @codester1989
    @codester1989 3 роки тому +5

    Fantastic tutorial series! Well thought out and explained - much appreciated!

  • @farzananasim9452
    @farzananasim9452 3 роки тому +3

    This video was extremely helpful. I watched this since I needed more understanding for my class and this was really well done, thanks!

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

    Dude you explain this stuff really well, best tutorial I found so far, could you do one about making a basic jumping character?

  • @bastigarratt
    @bastigarratt 6 років тому +2

    Thanks so much for the video Eric! This helped me out a ton. Your style is also so very likeable and beginner friendly. :D

    • @EricGallery
      @EricGallery  6 років тому +1

      Thank you, tell all of your friends.

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

    this has been an absolute life saver man, cannot thank you enough !!

  • @Tezzica
    @Tezzica 6 місяців тому

    My sprite continues to move with 'set animation speed' at 0. Not sure where I went wrong on following this or if the functionality changed on GM
    /edit: figured it out. my sprite must have glitched on the room after deleting and replacing it on the room, it worked like a charm.

  • @mimivrc4148
    @mimivrc4148 2 роки тому +24

    I know this is old, but to anyone finding this, I suggest you not use set direction and instead just set the "Set Speed" node to type: Horizontal for left and right and type: Vertical for up and down, make the speed negative on UP and Left, so using the variable example in the video, you type "-spd"
    this gets rid of the issue where combining key presses by pressing something like Up then Left/right at the same time can't combine while left then up/down works

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

      mate you are waffling

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

      thanks so much friend

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

      this also changes your movement from 4 direction to 8 direction (diagonal) so make sure that's what you want

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

      How would you make your character slide on a wall if I use up+right for example?

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

      @@Mangeurdemouton you can have the player collide with the wall. also gamemaker manual has very smooth 8 way movement that I recommend

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

    This was easy to follow. Thank you for your help. First time doing this.😊

  • @DeathDome_
    @DeathDome_ 7 місяців тому

    thank you ! but if i tap a direction quickly he doesnt take a step and still moves \slides, if i set sprite to frame 1 it breaks the animation speed. also i dont understand why "spd" is connected to set animation speed in the create event

  • @dreemurrZed
    @dreemurrZed 5 років тому +20

    nice tutorial but why is your mouse pointer so big

  • @FossyPickles
    @FossyPickles 4 роки тому +3

    Can you do a tutorial on room transistions?

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

    actually really useful tutorial man thx so much

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

    Hey, is there a way to make it that when the character walks up and is facing right, he does the right walking animation, and when he is facing left, he does the left walking animation when going up, instead of making a walk up animation? And vice versa for down?

  • @eesmvglsdabest3894
    @eesmvglsdabest3894 5 років тому +2

    What an EPIC GAMER!!!!!!

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

    this vid is 5 years ago but i'm having trouble with moving on the ground. for some reason my character isn't moving on the ground but it can move while hovering (i'm making a 2d platformer)

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

    what if i wanna make it to dance when i press letter on keyboard how do i make that

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

    Finally a helpful guide thank you
    But my character have an animation for when the player doesn't press anything how do I apply it?

  • @GearedGeek
    @GearedGeek 4 роки тому +1

    Can you make a video like this but include 8 way directional movement?

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

    thanks so much for this, it was super simple and helpful.

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

    when i want to create event it shows me the console not the thing u have...

  • @dummyslime7893
    @dummyslime7893 5 років тому +3

    Okay, so, I wanted my character to move diagonally, so I used the jump to point method, which works. However, whenever I try to walk diagonally up against a wall, my character freezes.
    I want to know if there's any way to fix this.

  • @benjstudios5526
    @benjstudios5526 4 роки тому

    Dude, thank you so much. This helped me a lot!

  • @patrickkirkby102
    @patrickkirkby102 5 років тому

    Anyone figure out how to "wall hug" against a wall. So that we slide along while angle walking, as opposed to stopping dead if you are holding a direction against the wall?

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

    the toturial is incredible but what about collisions

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

    When I hold down the 'right' key for example, my character moves to the right, and then if I press the 'down' key, he moves down even if I am still holding down the 'right' key. This is great, but it does not happen for all the directions. If I hold right and then hold up, the character does not go up until I let go of the right key. I can't figure out where the difference lies. How do I make it so that every key press is like the first example, so that no matter what key I'm holding in, a new direction will be activated when the associated key is pressed?

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

      It sounds like 8 Directions Movement could help you. Even if you do not want to move diagonally (8), you can tell the program to move as though you only have 4, I believe. If this nice creator doesn't have a video on it yet, the creator FriendlyCosmonaut does.

  • @Voidicus
    @Voidicus 6 років тому +1

    Hey Eric! I did all these steps, and yet my sprite is still going forever, and will not stop moving. What do I do?

    • @rehrocko
      @rehrocko 6 років тому +1

      Since everyone is being mean let me explain, for each key down, you have to add a key up, that says to set the speed to 0 and anispd to 0 so keydown right keyup right.

  • @doed68
    @doed68 6 місяців тому

    so i did this but now it just walks threw the wall object

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

    thank you so much! it was great help

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

    how do you get the toolbox out

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

    Wow you made those sprites good shit

  • @Kotjek
    @Kotjek 6 років тому +1

    but what if i wanna move up and right at the same time ... ?

    • @EricGallery
      @EricGallery  6 років тому +3

      If you want to be able to move diagonally by pressing two keys, you will need to use the Jump to Point action. For the Left key, set the x to -4 relative, and x to 0 relative. For Right, x to 4 relative, y to 0 relative. For Up, x to 0 relative, y to -4 relative. For Down, x to 0 relative, y to 4 relative. It is kind of demonstrated in my Platform video here ua-cam.com/video/ASeoKA8leU4/v-deo.htmlm2s

    • @Kotjek
      @Kotjek 6 років тому +1

      @@EricGallery thank u for ur answer
      i have kinda little problem cuz im new in gamemaker
      im kinda from the tgf2 /mmf2/click team 2.5 community
      i dont know anything about this
      can u help me a little? (im looking for some tutorials on DND with RPG styles and ideas ...
      like battles movement quests chests enemys ... TEXT showing things... ya know ... :S

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

    Ur so underrated have a sub thanks!!!

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

    I love you thanks for this ima binge watch all these ༼ つ ◕_◕ ༽つ❤❤

  • @loldorito
    @loldorito 5 років тому

    OMG! You're the best! Thank you so much! :) You saved me

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

    how do i set the key

  • @beechskullz
    @beechskullz 5 років тому

    So I have a problem? I did everything in the video but my character seems to glitch out. So when i move left and right its all good, up and down is fine, but if I go from left or right to up and down it glitches like a few cm away from where the character was.

    • @sevynwhatley3951
      @sevynwhatley3951 4 роки тому

      I'm having the exact same issue, did you ever figure it out?

    • @enashi6133
      @enashi6133 4 роки тому +1

      @@sevynwhatley3951 I'm having a similar problem but mine keeps looking to the left instead of down like it's supposed and its annoying lol

  • @SqweakySqwizard
    @SqweakySqwizard 5 років тому

    Thank you so much! This is a huge help

  • @FossyPickles
    @FossyPickles 4 роки тому +1

    Just what I need to make my rpg

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

    Nice tutorial. Using this for one of my games, HalfWay. However, I have one thing I'd like to do... Make it to where Jayde (The player) will sit. Seems easy enough. Just have to make it to where when down is pressed he'll play the sitting animation... But one issue I have is that I want him to face the direction he was already facing when standing up... Is there any way to do this?

  • @crazi_ninja8885
    @crazi_ninja8885 5 років тому

    This doesn't work fro some reason- i do have physics on though, does that interfere?

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

    how to get the toolbox?????????

  • @beechskullz
    @beechskullz 5 років тому

    When I move my sprite, first up and then left or right it glitches a few inches lower than it should be, how do I fix this?

    • @hellstrays7134
      @hellstrays7134 5 років тому +2

      you need to set the axis in the same spot for all of your sprites! :)

    • @enashi6133
      @enashi6133 4 роки тому

      @@hellstrays7134 Mine Jst Stays to the left when i walk even though i did everything he said. I'll try your advice! thanks

    • @enashi6133
      @enashi6133 4 роки тому

      @@hellstrays7134 still does the same shit XD DARN IT

  • @pcgaming6718
    @pcgaming6718 7 років тому +1

    Very nice thanks!

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

    thanks dude this will make murdirous mansion come out sonner

  • @bryanedge9011
    @bryanedge9011 4 роки тому

    Great tutorial! Straight and to the point! Great job!

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

    im completely new. You say set up the sprites? how? i have a sprite sheet with all the sprites on. How do i separate them?

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

      Watch this video:
      ua-cam.com/video/qfZxQYxLshE/v-deo.html

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

      @@EricGallery Thanks a lot!

  • @HiddenMatrixGaming
    @HiddenMatrixGaming 6 років тому

    when i comes to momentum of a sprite thats moving is it better to use code for that or drag and drop

    • @EricGallery
      @EricGallery  6 років тому

      I would normally use code, but this tutorial is for Drag and Drop.

    • @HiddenMatrixGaming
      @HiddenMatrixGaming 6 років тому

      @@EricGallery
      i'm doing code right now and if you have any understanding of how to use it, i'm trying make my sprite move, when i press the right key and, i'm struggling figure out how to make it move, since i've made it change its instance, but it doesn't move, stays in the same play as the idle sprite instance, just wondering if you know how to get it to work, i've also put this in a step event, the only event that i have right now.
      if keyboard_check_pressed(vk_right) x -= 5;
      {
      instance_change(obj_sonicrunning1, true)
      }

    • @EricGallery
      @EricGallery  6 років тому

      Move the moving command into the brackets like this
      if keyboard_check_pressed(vk_right)
      {
      x -= 5;
      instance_change(obj_sonicrunning1, true)
      ;
      }

    • @EricGallery
      @EricGallery  6 років тому

      Also, it looks like you are changing objects. Just change the sprite to the left facing sprites.
      are your sprites separated by direction? If not, watch this tutorial to show how to do that: ua-cam.com/video/qfZxQYxLshE/v-deo.html

    • @EricGallery
      @EricGallery  6 років тому

      If they are the code would be something like sprite_index=spr_sonicrunningleft

  • @sikonavideo9901
    @sikonavideo9901 5 років тому

    Anya work for me video?

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

    how did he get the toolbox?

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

      im thinking the same thing

  • @Liamvshobos
    @Liamvshobos 6 років тому

    When i create an event it shows no instances. Any ideas?

    • @juicyxmango
      @juicyxmango 6 років тому

      I had the same problem, and I was able to figure out how to fix it. After you create and event, right click on the event (such as 'Create') and convert it to DnD. Once the toolbox is opened you can delete the DnD instance that appears and it wont effect the movement. I did the rest of the tutorial like this and it worked fine.

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

    tysm man!

  • @aaronpike6902
    @aaronpike6902 4 місяці тому

    this saved me

  • @theunlicensedspycrab5348
    @theunlicensedspycrab5348 5 років тому

    the charachter doesn't appear for me. can you give some advice?

    • @EricGallery
      @EricGallery  5 років тому

      Where in the video are you having the problem? Can you see the character listed under Objects in the Resources window?

    • @theunlicensedspycrab5348
      @theunlicensedspycrab5348 5 років тому +1

      @@EricGallery in the room the background is black and the character is not showing up. yes i see it.

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

    Thank you

  • @jfmontagne
    @jfmontagne 7 років тому

    very useful, thank you. For the diagonal, if i have to press 2 keys (ex: up and left), do i have to code? or can i do it manually?

    • @EricGallery
      @EricGallery  7 років тому

      If you want to be able to move diagonally by pressing two keys, you will need to use the Jump to Point action. For the Left key, set the x to -4 relative, and x to 0 relative. For Right, x to 4 relative, y to 0 relative. For Up, x to 0 relative, y to -4 relative. For Down, x to 0 relative, y to 4 relative. It is kind of demonstrated in my Platform video here ua-cam.com/video/ASeoKA8leU4/v-deo.htmlm2s

    • @cisco2847
      @cisco2847 6 років тому

      @@EricGallery What if I want the player to rotate to look diagnolly while moving in that direction? How do I do that?

    • @EricGallery
      @EricGallery  6 років тому

      You would have to find a spritesheet with images at those angles. If you do a search for "spritesheet diagonal" or spritesheet 8-way" you may find something you are looking for.

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

    8:58 when i'm at here,
    my sprite said to me
    bye bye~

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

      What do you mean by "bye bye"?

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

      @@EricGallery
      The sprite is not longer on the screen

  • @skay3264
    @skay3264 4 роки тому

    Thank YOU! :))))

  • @rickvalk4091
    @rickvalk4091 6 років тому

    Thanks!

  • @itzfroggi22
    @itzfroggi22 5 років тому

    You saved my butt me dude :33

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

    tysm

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

    THANKSSSSS

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

    thanks

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

    mine wont stop moviinggg )))):

  • @SeanStinksAtRoblox
    @SeanStinksAtRoblox 5 років тому +1

    I’m gonna be real here, There are way better tutorials than this most scripts start with this (Not to be rude)
    If (keyboard_check(vk_something)) or you can do “ if (keyboard_check(ord(“Letter”)))
    And under that you do this: Sprite_index = sPlayer etc
    After that: Walkspeed: something.
    And then copy all that and do the same thing. It’s way more simple than this.
    Really hope this helped inexperienced coders and game developers.
    And as he explained it in DND™ || GML is easier for inexperienced coders and game developers
    So I will write the whole code here for the create event.
    Create:
    Image_speed = 0;
    Walkspeed = 3.5; //or lower.
    Next we move on to the step (Feel free to copy and paste this)
    If (keyboard_check(ord(“D”))) {
    x += walkSpeed;
    image_speed = walkSpeed /3;
    sprite_index = ???
    }
    If (keyboard_check(ord(“A”))) {
    x -= walkSpeed;
    image_speed = walkSpeed /3;
    sprite_index = ???
    }
    If (keyboard_check(ord(“S”))) {
    y += walkSpeed;
    image_speed = walkSpeed /3;
    sprite_index = ???
    }
    If (keyboard_check(ord(“A”))) {
    y -= walkSpeed;
    image_speed = walkSpeed /3;
    sprite_index = ???
    }
    And that’s it.
    For collision just add a collision to the player object which is simple
    There will be advanced here soon for platformer lol anyways enjoy this.
    But I know this is a long as hell comment but it’s useful for most starters.
    So you don’t need to like or anything but it’s appreciated so haha please sub at least
    (This whole comment took me 38 minutes to write..)

  • @lukediaz5291
    @lukediaz5291 4 роки тому

    i love you

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

    One thing that irritates me actually is that you did not indicate this was drag and drop tutorial otherwise I wouldn't have watched it

  • @firefuji3704
    @firefuji3704 6 років тому

    what do you use to make the sprites?!?

    • @EricGallery
      @EricGallery  6 років тому

      I just found them doing an image search on Google like "spritesheet 4x4"

    • @frickthisisdead2134
      @frickthisisdead2134 6 років тому

      lol had a feeling u did, they look low quality and shrunk.... no offense

    • @firefuji3704
      @firefuji3704 6 років тому +1

      i mean there pretty detailed and look pretty good tho but just pretty small like it just got smushed.

  • @DyzioThingsGang
    @DyzioThingsGang 6 років тому +2

    thats a big cursor

  • @tiagoorevoltado2273
    @tiagoorevoltado2273 5 років тому

    Hi guy I realy like the vídeo this realy can save my skin, BUUUTTT I realy like know if do you can teach us how the caracter can walk woth out commander. I mean same like a RPG NPC caracter. cold you teach us?

    • @hellstrays7134
      @hellstrays7134 5 років тому

      probably from the create event you can add movement and loop it

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

    didnt work

  • @isml756
    @isml756 5 років тому

    Pls gamr maker language

    • @EricGallery
      @EricGallery  5 років тому

      My Asteroids tutorial uses Game Maker Language (ua-cam.com/video/0lyLkhR0xpc/v-deo.html)

  • @baato870
    @baato870 6 років тому

    25 minutes?!?!?!?

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

    A

  • @Zentivated
    @Zentivated 6 років тому

    Nooob, you use Drag and drop

    • @EricGallery
      @EricGallery  6 років тому +6

      You did realize that this a tutorial for beginners brand new to GameMaker, right?
      If you want some GML go to my Asteroids tutorial
      ua-cam.com/video/0lyLkhR0xpc/v-deo.html

    • @dre_rona
      @dre_rona 4 роки тому +1

      You look like a guy who got 6 minutes into making a game, accidentally deleted your idle sprite, and quit trying to code a game