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

Поділитися
Вставка
  • Опубліковано 3 вер 2017
  • Tutorial for making a character with directional sprites move Left, Right, Up and Down.

КОМЕНТАРІ • 128

  • @WannabeComposer64
    @WannabeComposer64 5 років тому +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!

  • @copiousgarlicbread
    @copiousgarlicbread 4 роки тому +7

    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.

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

    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 8 місяців тому +1

      mate you are waffling

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

      thanks so much friend

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

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

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

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

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

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

  • @rosejuliette9180
    @rosejuliette9180 4 роки тому +8

    It's really handy that you did this tutorial in drag and drop. I'm only beginning learning and whilst I have experience with C and JAVA for basic things like web design using GML to assign all of these actions gets pretty confusing. Especially since it's not immediately clear to me what I have to program in and what is handled by the platform. Seeing all these actions as separate but working together not only helps me in drag and drop but also it lets me know all of the actions I would need in GML. I get that once you have the hang of it GML is faster and more flexible... But for a beginner it is a bit of a minefield.

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

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

  • @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.

  • @ajshitshed
    @ajshitshed 5 років тому +19

    nice tutorial but why is your mouse pointer so big

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

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

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

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

  • @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?

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

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

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

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

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

    actually really useful tutorial man thx so much

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

    Thank you so much! This is a huge help

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

    What an EPIC GAMER!!!!!!

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

    thank you so much! it was great help

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

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

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

    tysm man!

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

    Ur so underrated have a sub thanks!!!

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

    Very nice thanks!

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

    You saved my butt me dude :33

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

    Wow you made those sprites good shit

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

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

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

    Thanks!

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

    Thank YOU! :))))

  • @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?

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

    Just what I need to make my rpg

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

    Thank you

  • @dummyslime7893
    @dummyslime7893 4 роки тому +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.

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

    THANKSSSSS

  • @gamerguy8349
    @gamerguy8349 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?

  • @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?

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

    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?

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

    tysm

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

    thanks dude this will make murdirous mansion come out sonner

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

    thanks

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

    Can you do a tutorial on room transistions?

  • @DeathDome_
    @DeathDome_ Місяць тому

    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

  • @Tezzica
    @Tezzica Місяць тому

    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.

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

    i love you

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

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

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

    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  6 років тому

      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.

  • @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)

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

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

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

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

  • @Voidicus
    @Voidicus 5 років тому +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 5 років тому +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.

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

    the toturial is incredible but what about collisions

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

    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 2 роки тому

      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.

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

    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

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

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

  • @doed68
    @doed68 28 днів тому

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

  • @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

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

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

    • @EricGallery
      @EricGallery  5 років тому +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 5 років тому +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

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

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

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

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

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

      @@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  5 років тому

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

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

      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  5 років тому

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

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

    how do you get the toolbox out

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

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

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

      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.

  • @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!

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

    how do i set the key

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

    Anya work for me video?

  • @Sakura_Animations
    @Sakura_Animations 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"?

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

      @@EricGallery
      The sprite is not longer on the screen

  • @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.

  • @ThatDudeExo
    @ThatDudeExo 4 роки тому +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..)

  • @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.

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

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

  • @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

  • @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

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

    thats a big cursor

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

    how did he get the toolbox?

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

      im thinking the same thing

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

    "simple character movement"
    TWENTY FIVE MINUTES

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

    25 minutes?!?!?!?

  • @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)

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

    A

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

    Nooob, you use Drag and drop

    • @EricGallery
      @EricGallery  5 років тому +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 3 роки тому +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