Super Mario - Running Tutorial in Unity

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 88

  • @nezbitnezbit5397
    @nezbitnezbit5397 5 лет назад +49

    You are definitely one of the most underated unity youtubers

    • @pressstart6864
      @pressstart6864  5 лет назад +4

      Thanks man!

    • @fantastico69
      @fantastico69 4 года назад

      ​@@pressstart6864 Return with the videos, pls
      Your videos help a lot, because you explain the logic, no just the code itself.

    • @DemonkaiMugen
      @DemonkaiMugen 3 года назад

      yeah i co sign that majorly

  • @widecarrot
    @widecarrot 5 лет назад +7

    These series are so good! Quality is clearly a top priority in this channel

    • @pressstart6864
      @pressstart6864  5 лет назад +1

      I'm glad you're enjoying the series. And yes quality is most important to me!

  • @DemonkaiMugen
    @DemonkaiMugen 3 года назад +1

    MAN you are the greatest teacher for this smh i went through at least FIVE youtubers trying to explain animation transition and they were horrible at it i see. i kept being left without a clear great answer for a week! Anyway this is my first month starting Unity and trying my hand at a 2D platformer and transitioning and getting my sprite to turn around was the hardest damn thing to pull off. i have to save and download your video.. its the best. thanks for breaking this down. i finally got it right

  • @ItamiPlaysGuitar
    @ItamiPlaysGuitar 4 года назад

    Anybody who wants to create a platformer needs to watch this. Thank you so much

  • @LennoxParsec
    @LennoxParsec 3 года назад

    This is the only video that explains how to move an object in a constant velocity using .AddForce instead of .velocity
    Thank you so much.

  • @orkbadger
    @orkbadger 4 года назад

    Dude, whoever you are, you are a fucking blessing let me tell you. Was gonna check your jumping code only, and thought to myself "I already know the movement part", but after checking this, the stuff you write seems super simple and understandable, yet complex on a different level in terms of game mechanics. You really taught me a lot in a subject that I thought I knew well. Hope you get the subs number you deserve soon.

  • @ashfid8987
    @ashfid8987 5 лет назад +5

    Really enjoy these videos. I make systems of my game most of the time. I am really bad at how to make things look good, you helped me a lot of times to recreate something from older games and I seriously want to thank you for it. I agree, you are definitely underrated. Great presentation, consistent flow of explanation and short videos on single topic.

    • @pressstart6864
      @pressstart6864  5 лет назад +1

      I really appreciate the kind words and I'm glad I could help you in your game dev journey.

  • @SeppvonderWeide
    @SeppvonderWeide 4 года назад

    This is just perfect man! You are one of the few unity youtubers who don't just copy stuff and have no clue what they are talkin about! U implemented everything in an unique way with perfect explanation! I've watched a lot of these tutorials lately and this is the best.

  • @Anuiran
    @Anuiran 5 лет назад +3

    I can see this channel blowing up in a month or two, you do great work.

  • @burnobad
    @burnobad 4 года назад +2

    Thit is amazing tutorial, your channel is what i was searcing for ages

  • @PeopleLeapOn
    @PeopleLeapOn 5 лет назад +3

    Great video man, clear and not too long, keep on this path! i'm waiting the jumping tutorial!

    • @pressstart6864
      @pressstart6864  5 лет назад

      Thanks for the feedback. Working on the jumping video today, hoping to have it done for October 15th, release.

  • @gomango99
    @gomango99 3 года назад

    I love your controller script so much! I altered it to work with the new input system and it worked perfectly

  • @eliplay123
    @eliplay123 2 года назад +2

    If someone's still watching this, the code has an error at this line of code: "Mathf.Abs(direction.x) < 0.4f"
    The reason for this is that we use "GetAxisRaw()" for getting Input parameters and that function returns either -1, 0 or 1 so it will never be ranging between those values.
    To fix this, you can use "(Mathf.Abs(direction.x) > 0f && changingDirections == true)" instead.
    Hope it helps!.

    • @mounik009
      @mounik009 2 года назад +1

      Thank you, I was facing the same issue.

  • @tomasagustin3382
    @tomasagustin3382 5 лет назад +1

    Best of all tutorial ive seen, pls countinue doing videos! hug from Argentina!

  • @abhilashpawar1875
    @abhilashpawar1875 4 года назад +1

    Whoa man! Great tutorial! I got smooth movement because of you!

  • @davegamedevelopment
    @davegamedevelopment 4 года назад +5

    Nice, thanks for your awesome tutorial!
    Very helpful :D

  • @paulrumyancev
    @paulrumyancev 3 года назад +4

    I think that "Mathf.Abs(direction.x) < 0.4f" check is a little mistake. The author uses GetAxisRaw() for getting Input parameters and the function returns either -1, 0 or 1 and will never be ranging between those values.

  • @GwynPerry
    @GwynPerry 5 лет назад +2

    You can resolve the tile collision issue by using a composite collider. Just remember to set the tilemap's rigid body to static.

    • @pressstart6864
      @pressstart6864  5 лет назад

      Hmmm

    • @benjamingerd4703
      @benjamingerd4703 5 лет назад +1

      Agreed. When working with Tilemap, using a CompositeCollider in addition will solve issues that arise from your character colliding with the edge where two tiles meet.

    • @andrew_ceco
      @andrew_ceco 3 года назад

      I haven't learned how to use composite colliders yet, and I can't say I know what's better in terms of runtime or efficiency and such, but I've found that adding a physics material to the edge collider has effectively solved this problem for me too :)

  • @kaiser9321
    @kaiser9321 5 лет назад

    If you click on your tiles and your collider is defined by a bunch of boxes, you should add a composite collider as well which will also include a Rigidbody 2D, just set that to Static and it shouldn’t be doing what’s happening at 7:10

    • @benjamingerd4703
      @benjamingerd4703 5 лет назад +1

      Agreed. When working with Tilemap, using a CompositeCollider in addition will solve issues that arise from your character colliding with the edge where two tiles meet.

  • @uba754
    @uba754 4 года назад +1

    Phenomenal video! I was just about to ask a question and then I realized my own error haha.

  •  5 лет назад +1

    Very nice stuff! Keep up the good work

  • @atifahmad6457
    @atifahmad6457 3 года назад

    Awesome trick with that rotate 180

  • @karacter3369
    @karacter3369 Год назад

    this is soooooo good and simple!

  • @maistrogaming7911
    @maistrogaming7911 5 лет назад +2

    keep making video one day you will get 1 m subs...u r one of the best..like to who think i am right

  • @charliecooper3030
    @charliecooper3030 4 года назад +2

    Why did you put the CharacterController script on the top level player game object in the first video but in this video it's not there, just Rigidbody 2D and the Player script?

  • @JoseCruz-qs1pw
    @JoseCruz-qs1pw 4 года назад

    What amazing tutorial!
    Keep this videos quality :)

  • @SageNode
    @SageNode 4 года назад +3

    why in this video you took out the vertical parameter and the fall animation?

  • @ITeachChemistry
    @ITeachChemistry 5 лет назад

    Your work is awesome man. Keep going!!!

  • @rezmon5311
    @rezmon5311 5 лет назад +1

    Great overall videos! Subbed and notification bell ringed! Looking forward for more content :)

  • @swarth8632
    @swarth8632 4 года назад

    Really helpful tutorial! Subbed!!!

  • @laserrays9x3
    @laserrays9x3 3 года назад

    really great video. helped a ton

  • @Charlie59876
    @Charlie59876 2 года назад +1

    is there a way to change how fast the player accelerates?

  • @marianogonzalez4663
    @marianogonzalez4663 4 года назад +1

    Hi, thank you very much for the free learning resources, it's really helpful when starting out. I wanted to ask you, why you use an edge collider instead of a box collider? To me they seem to be pretty much the same thing.

  • @DrLengen
    @DrLengen 3 года назад

    Now how do I do this in 4 directions? I'm having trouble with the New Input System.

  • @bigjamar
    @bigjamar 5 лет назад +2

    Excelente..!!

  • @SageNode
    @SageNode 4 года назад +1

    Im getting an error and im not able to move.
    the error is:
    ArgumentException: Input Axis Verticle is not setup.
    To change the input settings use: Edit -> Settings -> Input
    PlayerCharacter.Update () (at Assets/Scripts/PlayerCharacter.cs:44)
    cs:44:
    direction = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Verticle"));
    Im stumped, becuase ive checked my input settings over and over in unity and everything is set

    • @SageNode
      @SageNode 4 года назад +1

      ah.... I spelt Vertical wrong lol

  • @praetosstuff8230
    @praetosstuff8230 4 года назад

    I need help. When I quickly double tap the button associated with the direction I am facing, I can't move in whatever direction I was facing. Any idea on how to fix this?

  • @link64_blend95
    @link64_blend95 3 года назад

    in my case the rigidbody doesn't change the linear drag. does anyone know how i can fix this?

  • @canuniverse3367
    @canuniverse3367 3 года назад

    ahh hey, I have an issue that my players edge collider stucks to the edges of my tile map collider if I use a composite collider for tile map then the edge collider doesn't work is there any way to solve this

  • @JKMT
    @JKMT 4 года назад

    underrated, although seems like a lot of code for that smoothness

  • @seighart90
    @seighart90 3 года назад

    Why don't you use velocity instead of addforce?

  • @avi6961
    @avi6961 4 года назад

    Can I use the same code for the Mario game created in 3D?

  • @s41to
    @s41to 4 года назад +1

    i have a problem when my character changes directions, the idle animation is called for a sprite when is already moving in the other direction.

    • @Masterxroshi
      @Masterxroshi 4 года назад

      probably abit late but its got to do with how you setup the animations. watch some videos on transitions and you will understand. to give you the gist of it, disabling exit time and editing the transition time to lower values makes the transitioning between animations more fluid. i recommend watching blackthornprods video on animation to get all the details but I'm sure theres many other RUclipsrs who can give you the same info.

  • @Yamam100
    @Yamam100 4 года назад

    amazing

  • @LegendJ0e4
    @LegendJ0e4 4 года назад

    when my character goes to run left, he doesn't turn to face left why

  • @thangnobita1739
    @thangnobita1739 3 года назад

    thank you so much

  • @MikeKing710
    @MikeKing710 4 года назад

    Well, is it not good to use for 3d player object?

  • @hunkydoodle2374
    @hunkydoodle2374 4 года назад +1

    I'm having trouble with getting this to handle slopes, my characters little legs are just too weak!

    • @voidling2632
      @voidling2632 4 года назад +2

      don't use rigidbody2D.addforce if you use slopes... either write your own physics... or just use
      rigidbody2D.velocity = new Vector2(moveSpeed*direction.x,rigidbody2D.velocity.y)

  • @derekw8039
    @derekw8039 4 года назад

    How do you do this in 3D?

  • @SageNode
    @SageNode 4 года назад

    I had to get rid of this line of code cause it kept giving me an error saying that string doesnt exist when it clearly did exist. and it seems this line of code didnt do anything anyways
    animator.SetFloat("horizontal", Mathf.Abs(rb.velocity.x));

  • @SageNode
    @SageNode 4 года назад +2

    When making the transitions between animation states at the end of the last video, you skip showing the transitions for the falling animations, you only show fall -> idle
    im having trouble getting it to work

  • @mueqatrae1464
    @mueqatrae1464 5 лет назад +1

    if you don't use AddForce for the player movement you can avoid all those headaches

    • @pressstart6864
      @pressstart6864  5 лет назад

      Sure, if you don’t want to use any physics or collision elements in your game, but most platformers do. I try to avoid using addForce as much as possible but if you want a true to feel character controller, it’s sort of unavoidable.

    • @benjamingerd4703
      @benjamingerd4703 5 лет назад

      @
      MueqaTrae It appears as though he is using `rb.AddForce` here to avoid having to implement his own movement acceleration. Since `rb.AddForce` adds to the character's existing velocity every frame, it effectively gives him the acceleration he desires for a Mario like game feel. However, I also noticed that he is mixing the use of `rb.AddForce` and `rb.velocity` in his code.

    • @benjamingerd4703
      @benjamingerd4703 5 лет назад

      @PressStart Is there a specific reason you decided against defining an acceleration constant and integrating the movement yourself? (re "if you want a true to feel character controller, [using AddForce is] sort of unavoidable")
      ```
      // Acceleration per physics step
      [SerializeField] private float moveAcceleration;
      private void moveCharacter()
      {
      rb.velocity = new Vector2(
      rb.velocity.x + (
      direction * moveAcceleration * maxSpeed * Time.fixedDeltaTime
      ),
      rb.velocity.y
      );
      // (...)
      }
      ```

  • @noahlevine7894
    @noahlevine7894 4 года назад

    why did you use rb.Addforce instead of rb.MoveCharacter?

    • @efn5520
      @efn5520 4 года назад

      Because he wanted acceleration

  • @sirgaming-gaminglikeasir9360
    @sirgaming-gaminglikeasir9360 4 года назад

    What about transform.position lol

  • @mexagrontoo
    @mexagrontoo Год назад

    please come back!

  • @djninjitsuchannel7857
    @djninjitsuchannel7857 4 года назад

    I love you

  • @SantiagoMaki
    @SantiagoMaki 2 года назад

    1000th like

  • @captainhoneybee8435
    @captainhoneybee8435 4 года назад

    If there is one thing I'll take away from this is to use the "animator windor"

  • @CYB3Rsynth
    @CYB3Rsynth 3 года назад +1

    great video...but damn if your coding style doesnt frustrate the hell out of me lol. most unpretty... like bruh Capitalize your functions

  • @SageNode
    @SageNode 4 года назад +2

    well, whole day wasted. start from scratch tomorrow

    • @BobrLovr
      @BobrLovr 4 года назад

      why do you have to start from scratch lmao. Imagine starting over every time something doesn't work out