Unity 2D Platformer Tutorial 3 - How To Detect Ground Check For 2D Character Controller

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

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

  • @sodanice3214
    @sodanice3214 3 года назад +16

    I am a beginner in Unity in Japan. The explanation of Unity is easy to understand and it is helpful!

    • @Antarsoft
      @Antarsoft  3 года назад +5

      I'm happy it's helpful, keep working hard and if you need help please let me know, you can join our discord channel

  • @jeykey7140
    @jeykey7140 3 года назад +2

    Really undervalued channel. Love the tutorials, even if I just use bits that I need, I recomend watching the entire thing.

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

      Cheers 😇😇😇 comments like these make my day
      I'm glad to be able to help

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

    awesome tutorial! I created a VR game using Unity for my Thesis! nice content here!

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

      Thank you, what’s your VR game about?

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

      @@Antarsoft he never responded what it was a bout :(

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

      Who's he ?

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

    Thank you very much!! I have been struggling on it for hours!

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

      You're welcome Melaniia, I'm glad it helped you

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

    I loveee this channel. I'm new to coding and this has been so helpful. I'd love to be a patron.

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

      Heyoooo 😇😇😇 I'm very happy to be able to help and thank you for your gracious support

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

      If you want to become a patron please find the link in the description 😇

  • @gazalgamer3250
    @gazalgamer3250 4 месяца назад

    For new unity versions, you must put the "GroundqCheck" void name in the Update void ❤

    • @ObitoUchiha-zu9yn
      @ObitoUchiha-zu9yn Месяц назад

      What do you mean, it's not actually necessary, The name of the function can be anything!

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

    Ah a tutorial that has running walking jump falling crouch camera all in one perfect for my rayman ps1 project

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

      😁

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

      Yeah! and guess what he is going to add couple more mechanics as well, hopefully soon.

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

    Thanks a lot! It worked better than the raycast.

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

      Glad to hear that 😇

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

    How do you get the [SerializeField] and other stuff like that to light up blue

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

      If you mean changing the color, you can modify that using visual studio settings, can't remember exactly where but you'll find a place maybe called "themes" where you can change those things

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

    thanks for the tutorial :) It helped me a lot

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

      You're welcome 😇😇😇

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

    Thank you!

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

      You're welcome 😇

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

    Great tutorial, but I'm having a small issue. Everything in unity is like 10 times smaller, like when I added the collider the first time to the floor, it automatically set the size to 0.6, but in your case it is 1.6. same thing when we got the values for the walk and run animations like it's 10 times smaller. I had to set the radius for the empty game object for ground check to 0.02 instead of 0.2. I'm not sure what my problem is if you can shed some light on this issue

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

      Hey,
      Working with 2D sprites can be a tedios if you want to follow up someone else's work, as the sizes of the sprites may differ then the pixel-size itself can be different as well as the camera size in the scene, so if you are facing scaling issues it's most likely due to not the same settings as the ones in the tutorial but it's as simple either relooking the video and making sure the settings are similar or work it out yourself as you did, and adjust the sizes to fit your settings.

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

    why so much trouble when you can simple check ground collision with a OnColissionEnter function?

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

      There are so many ways to implement, if you feel this is too much try your approach

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

    hi i was using this tutorial but the ground check collider isn't popping in the inspector what should i do?

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

      Hey
      If you can show me the code here or join the discord channel and post it there
      www.discord.gg/zcZTAQq

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

      @@Antarsoft Hey! I left a message on your discord with a similar question. Would really appreciate some help!

  • @voltorian-minecraft
    @voltorian-minecraft Год назад

    looks like this works for if the character is like, "halfway" on a platform, right? so if the character is on the edge of a platform, but the center point is past the edge, it won't detect as grounded

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

      Totally true, that would be an edge case -literally- where we need to have side detectors.

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

    I got the error "Collider2D[] does not contain a definition for "length" and no extension method for "length""

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

      Hey,
      That's weird cause it's an array and it has built in length parameter,
      Can you please join the discord channel and post the code and I can assist you from there easily

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

      i have the same problem

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

      Never mind my dumbass friend misspelled length.

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

      😄 nothing beats fixing a bug

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

      @@moiseicho5133 Dude I just realized I did the same thing...

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

    hey, maybe it's my fault, but after the groundcheck addition to the script of my character i am no longer able to move. Anybody knows what could it be?
    P.S.: it appears not to be any error in the script, and even though the isGrounded bool becomes true when it is true, i cannot move...

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

      First of all, no need to say it's your fault :) mistakes happen from either side and what programmers like yourself would do is try and solve them.
      So you said after adding the ground check logic your character stopped moving, so what you can do is check the ground logic and run in debug mode and add breakpoints after each step you added, if you don't know how to do that properly then try removing/commenting bits step by step to know what cause the issue.
      I'm sure there's a boolean check somewhere that prevents the user from accepting move logic

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

    mouse scroll problems, I can feel you man.

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

    Make a tutorial about main menu

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

      I'll put it in the agenda.
      Thanks for the suggestion 👍🏻

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

    Why no raycast tho?

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

    i can mail my code and inspector screenshot

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

      Join the discord channel and you can directly send the code or snapshot or video there
      www.discord.gg/zcZTAQq
      I can help you easily

  • @alphaakuma9084
    @alphaakuma9084 3 года назад +2

    This tutorial just doesn't work, been trying for weeks to get this to work properly. The ground check works fine but I still have infinite jump no matter what I do

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

      Damn, sorry to hear that, I'll help you out, do you mind jumping into the discord channel? Maybe there we can see what's the issue

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

      @@Antarsoft Heya man, really appreciate the offer! But I just decided to experiment myself and used an If Else statement, Im surprised no other tutorial did that.
      Really do appreciate the offer tho, your a great content creator :)
      keep up the good work!!!!!

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

      Great work 😇😇👍🏻👍🏻 thank you got the kind words

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

    really good tutorial just got little problem on the end of it it say "animator.SetFloat("xVelocity" , Mathf.Abs(rb.velocity.x));" but "SetFloat" is underlined and unity say it was error "cs1061" i don't know how to fix it if you could help and still thx for the tuto.
    (also really sorry if its hard to read im not english and not so good at it)

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

      Hey sorry for late reply,
      Usually cs1061 is referred to an non-existing method.
      So it's either you have an issue with the spelling, or the "animator" isn't the correct object .
      Or could be a bug in Visual Studio not compiling the UnityEngine framework.
      If you haven't solve it yet I'd suggest restarting your unity and if not, join our discord and post your code snippet there in the help section, we might be able to help you out

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

    u can just do
    /*
    (your text here and how long u want)
    */
    so u can put long comments
    Edit: bool isGrounded = false; does not work and i use it for stickman

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

    Good tutorial.... keep it up.... I wait for your return response.

  • @gabrielkarczewski4453
    @gabrielkarczewski4453 3 года назад +2

    Thanks for the video, although just a tip - perhaps try to think more about how you want to explain everything or plan it out before. You're a bit chaotic and it's distracting.

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

      Thank you, I do the planning but I have run into some complications in couple videos, yes.
      Will do more thorough planning.
      Appreciate the feedback 😇