How to Check if Your Player is GROUNDED Unity Tutorial

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 30

  • @SoraBorg
    @SoraBorg 4 роки тому +23

    I can already see an exploit here. The speed change is being calculated based on the slopeAngle, which itself is dependent on direction. This means that a player walking backwards up a slope would move faster.

    • @mrkoix2398
      @mrkoix2398 4 роки тому +11

      this is intentional for speedrunners obviously.

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

      How would you fix this

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

      this is not a bug it is a... FEATURE! yeah we all obviously want this for speedrunning and we are TOTALY not trying to avoid more debugging. psh who would do that!

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

      @@mrkoix2398 😂

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

      Did you just discover B hopping in half life?

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

    Use the direction the player is trying to move to calculate the speed rather than the way you are facing. Otherwise, you can run uphill really quickly if you walk backwards.

  • @Zicrus
    @Zicrus 4 роки тому +4

    Use spherecast instead of raycast, because with raycast, the ground needs to be directly below the center of the player. With spherecast you can still jump if you are on the edge of a cliff.

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

    Man, just thank you so much! Been looking for a raycast decision for 2 days and absolutely broke my head of the wall. Thank you sooo much!

  • @M3RS.
    @M3RS. 4 роки тому

    I just found your channel and I liked the crosshair video and this one since it told me how to do the thing I wanted which is being slowed down on slopes. It was hard to find a tutorial for that.
    Can I ask if you could consider these stuff for the next tutorials?:
    - Crouching under objects and standing up will not push you out from under it (meaning you will stay crouched under the object when the crouch button is released)
    - You slow down when crouching (tutorials from big UA-camrs like Brackeys did not bother with this)
    - Crawling (you are completely on the ground and are even slower then crouching)
    - Jump or sprint out from crouching position (when crouching pressing Shift for sprint and W for forward you will uncrouch and start to sprint or start jumping with the Spacebar)

  • @theandyd1972
    @theandyd1972 4 роки тому +2

    Really excellent explanation as always, thanks so much for taking the time to run through this and break it down. You are really helping me out a great deal get to grips with Unity and code around generating these game types. Keep up the great work and why so many views but so few likes, come on guys support click that like Button !

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

    thank you so much man, i spent all day trying to do this and i couldn't, i was watching a vid from Brackeys, and when i used your vid i got it first try. this is a way better video then brackeys not even joking

  • @ruchirraj5300
    @ruchirraj5300 4 роки тому +2

    This implementation has a lot of limitations and bugs for it to be implemented in an actual game,
    The only place I maybe would use such a basic implementation is a game like minecraft, even in that it won't work in 60% of the cases, for ex, on ledges or on steep slope

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

    I was really hoping you would solve the character "bouncing" down the slope when going too fast down...
    Otherwise, really great ideas and suggestions! :)

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

    after 30 minutes of frustation i found out that for some reason visual studio automatically corrected transform to _cameraTransform XD

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

    Omg ty soooo much for this. i almost gave up on this.

  • @10gbo_pizza
    @10gbo_pizza 3 роки тому

    this was really helpful! thanks!

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

    Wonderful tutorial. The only issue I am still having with this and the one in the Minecraft series, is you can flip the camera upside down. Any chance of a quick part 3 for that? I know you mentioned you were going to compile a bunch of small things but yea, that would be something SUPER beneficial!

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

    Bookmarked this video under #gold

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

    Was going nutz in the first 5 minutes because that raycast was not working on terrain. Put a box under my player and it suddenly worked. How can I make this work with the terrain?
    EDIT: Its actually not working when the terrain is flat.

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

    Thanks, you helped me allot.

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

    What about stairs? How would you do a character controller with a rigidbody properly wotk with stairs?

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

      Character controller is best for stairs. or you could do a raycast on the feet and just above them.

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

    rly helpful

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

    how does it not know that the player is grounded

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

    hi early!

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

    Can you check out my game? Thanks