HOLD JUMP KEY TO JUMP HIGHER - 2D PLATFORMER CONTROLLER - UNITY TUTORIAL

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

ความคิดเห็น • 633

  • @not2shabby17
    @not2shabby17 6 ปีที่แล้ว +197

    The ad before the video was about how to jump higher in basketball lol.

    • @greyenbee9049
      @greyenbee9049 4 ปีที่แล้ว +21

      i mean all ya gotta do is delete the check for if you are on the ground. them NBA player don't know this yet

    • @pulkit.guglani
      @pulkit.guglani 4 ปีที่แล้ว +3

      @@greyenbee9049 That's really funny, sad part: No one noticed or understood it.

    • @tinemupfacha6051
      @tinemupfacha6051 3 ปีที่แล้ว +1

      @@B8Code Stop advertising please

    • @B8Code
      @B8Code 3 ปีที่แล้ว +1

      @@tinemupfacha6051 srry this was 4 months ago but now i stopped

  • @mouse372700
    @mouse372700 6 ปีที่แล้ว +424

    hi i'm korean
    -this sentence is Google Translator
    I was almost giving up implementing this function
    thank you so much for tutoring this function.
    I wish you more subscribers.
    ^^b

    • @mintesnotmelese6552
      @mintesnotmelese6552 5 ปีที่แล้ว +1

      lol

    • @sugaristhenewwhite
      @sugaristhenewwhite 5 ปีที่แล้ว +15

      hi korean
      -this sentence is Google Translator
      I was almost giving up implementing this function
      thank you so much for tutoring this function.
      I wish you more subscribers.
      ^^b im sugar

    • @Laranthir
      @Laranthir 4 ปีที่แล้ว +8

      Dad jokes.. Dad jokes everywhere

    • @EnderElectrics
      @EnderElectrics 4 ปีที่แล้ว +1

      @@sugaristhenewwhite I love you

    • @sugaristhenewwhite
      @sugaristhenewwhite 4 ปีที่แล้ว +1

      @@EnderElectrics owo

  • @aaronhambling4256
    @aaronhambling4256 6 ปีที่แล้ว +82

    Excellent tutorial dude. I don’t really have any specific requests right now but keep it up your killing it right now with these vids. Dare I say overtaking brackeys as one of the best unity youtubers atm.

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +7

      Thanks so much for the encouraging feedback :) ! I'm definitely going to keep up this content !

  • @quinncraven-pittman
    @quinncraven-pittman 3 ปีที่แล้ว +158

    If your character gets stuck on a wall when you touch it, make a new Physics Material 2D in your assets, then set the friction to 0, and add it onto the collider on your player. :)

  • @nicemikespeedruns
    @nicemikespeedruns 5 ปีที่แล้ว +10

    You are such a good TH-camr! Every time when I am searching for programming tutorials, nothing works but yours. Thanks for all!

    • @DrFross09
      @DrFross09 5 ปีที่แล้ว +4

      That's the worst I remember, when I was a Uni-noob, spending Weeks following a 14 part tutorial that left me with just this garbage code, that i didn't know (at that time) how to fix. I feel your struggle.

  • @havendewart
    @havendewart 3 ปีที่แล้ว +39

    Here is some improved code that fixes a double jump bug and adds cool fall physics as well as better organization. I got the cool fall from a video called better jump with 4 lines of code. I recommend values of 2 and 2.5 for the fall multiplier variables.
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class PlayerMovement : MonoBehaviour
    {
    [Header("Components")]
    private Rigidbody2D rb;
    public float speed;
    public float jumpForce;
    private float moveInput;
    [Header("Layar Mask")]
    private bool isGrounded;
    public Transform feetPos;
    public float checkRadius;
    public LayerMask whatIsGround;
    [Header("Jump")]
    private float jumpTimeCounter;
    public float jumpTime;
    private bool isJumping;
    [Header("fall physics")]
    public float fallMultiplier;
    public float lowJumpMultiplier;
    //Gets Rigidbody component
    void Start()
    {
    rb = GetComponent();
    }
    //Moves player on x axis
    void FixedUpdate()
    {
    moveInput = Input.GetAxisRaw("Horizontal");
    rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);
    }

    void Update()
    {

    isGrounded = Physics2D.OverlapCircle(feetPos.position, checkRadius, whatIsGround);
    //turn twords you go
    if (moveInput > 0)
    {
    transform.eulerAngles = new Vector3(0, 0, 0);
    }
    else if (moveInput < 0)
    {
    transform.eulerAngles = new Vector3(0, 180, 0);
    }
    //cool jump fall
    if (rb.velocity.y < 0)
    {
    rb.velocity += Vector2.up * Physics2D.gravity.y * (fallMultiplier - 1) * Time.deltaTime;
    }
    else if (rb.velocity.y > 0 && Input.GetKey(KeyCode.Space))
    {
    rb.velocity += Vector2.up * Physics2D.gravity.y * (lowJumpMultiplier - 1) * Time.deltaTime;
    }
    //fixed double jump bug
    if (Input.GetKeyUp(KeyCode.Space))
    {
    isJumping = false;
    }
    //lets player jump
    if (isGrounded == true && Input.GetKeyDown("space") && isJumping == false)
    {
    isJumping = true;
    jumpTimeCounter = jumpTime;
    rb.velocity = Vector2.up * jumpForce;
    }
    //makes you jump higher when you hold down space
    if (Input.GetKey(KeyCode.Space) && isJumping == true)
    {
    if (jumpTimeCounter > 0)
    {
    rb.velocity = Vector2.up * jumpForce;
    jumpTimeCounter -= Time.deltaTime;
    }
    else
    {
    isJumping = false;
    }

    }

    }

    }

    • @guille_sanchez
      @guille_sanchez 3 ปีที่แล้ว

      Does anyone know how to add a controller button apart from the keybutton "space"?

    • @Santosos255
      @Santosos255 2 ปีที่แล้ว +1

      @@guille_sanchez you can do it with strings

    • @PuraCaseus
      @PuraCaseus 2 ปีที่แล้ว

      Thank you!

    • @havendewart
      @havendewart 2 ปีที่แล้ว +1

      Make sure your grounded detection is working. If your player is set to your ground layer that could also be the issue.

    • @Tank3344-u2w
      @Tank3344-u2w 2 ปีที่แล้ว

      it gives me this error plz help NullReferenceException: Object reference not set to an instance of an object
      PlayerMovement.Update () (at Assets/finshed scripts/PlayerMovement.cs:49)

  • @babywithatank9565
    @babywithatank9565 6 ปีที่แล้ว +87

    I got an ad for a basketball tutorial on how to jump higher, irony of it.

    • @noellekkar903
      @noellekkar903 4 ปีที่แล้ว

      😂😂

    • @itsmyfavgameseries
      @itsmyfavgameseries 4 ปีที่แล้ว +2

      The comment above yours had the same ad 😳

    • @IDontReadReplies42069
      @IDontReadReplies42069 4 ปีที่แล้ว

      that is in no way shape or form ironic, please look up the definition of irony.

    • @benedglazer
      @benedglazer 3 ปีที่แล้ว

      @@IDontReadReplies42069 bruh.

  • @lesarch
    @lesarch 5 ปีที่แล้ว +1

    You saved my life man. I was fumbling through the internet looking for a way to do the variable height jump and this fixed everything. Thanks!!

  • @williamstrnad4243
    @williamstrnad4243 6 ปีที่แล้ว +107

    Yay, another episode, could you by any chance make a boss battle tutorial

    • @rohitalawa9306
      @rohitalawa9306 6 ปีที่แล้ว +1

      William Strnad
      Yes

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +36

      I think that would be really interesting :) ! I could add it to my AI series perhaps.. yep, I think it's an awesome idea actually, stay tuned !

    • @AhmedKhalfYolo
      @AhmedKhalfYolo 6 ปีที่แล้ว +1

      Blackthornprod thank you :) I'd like like a boss tutorial too

    • @arikty8966
      @arikty8966 6 ปีที่แล้ว

      Also really want a boss battle tutorial. :'D

    • @turtlehub2731
      @turtlehub2731 5 ปีที่แล้ว

      make a ememy, but stronger and with more atttacks

  • @havendewart
    @havendewart 4 ปีที่แล้ว +6

    After 3 hours of frustration, it works. I So find happy lol. And to everyone who had trouble just persevere.

    • @B8Code
      @B8Code 4 ปีที่แล้ว

      th-cam.com/video/YzCF3zbfUE0/w-d-xo.html

  • @vitorpaulinogoncalves936
    @vitorpaulinogoncalves936 6 ปีที่แล้ว +2

    Although I am not so fluent in English to understand all the dialogues, I learn a lot from these videos. I am Brazilian. :D

  • @donutdude4174
    @donutdude4174 6 ปีที่แล้ว +10

    Your video Quality has gone up incredibly I've been watching your videos since the 2D character customizer one of your early videos now your like Super Efficient with your Code and informative. Your videos are Really Good my Friend keep up the Amazing work Noah & Friends I Appreciate It Thank You! 👌👍

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +1

      Thanks so much :) ! Yep I'll try my best to keep improving my content, with motivating comments like yours I'm definitely keeping it up !

  • @toastedperfection2488
    @toastedperfection2488 6 ปีที่แล้ว +12

    This is the earliest I've ever been. This is because this is the second video I've watched since I've subbed. I watched lots of older videos & newer ones & I decided to subscribe. Thank you so much for all the help. This channel is awesome. I hope to see you continue doing videos.

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +1

      Thanks so much for the support :) ! This is really just the beginning of me and my channel's journey, you can expect plenty more :) !

  • @NM-jw9jh
    @NM-jw9jh 4 ปีที่แล้ว

    a free simple working tutorial on jumping without premade controller??? is this a dream??

  • @timgal5868
    @timgal5868 3 ปีที่แล้ว +2

    I'm trying to do the same thing in Love 2D and your tutorial actually really helped! I finally understand how this sort of jump works and I was able to reverse engineer your code into my Love 2D Lua project. Thank you!

    • @guille_sanchez
      @guille_sanchez 3 ปีที่แล้ว

      Does anyone know how to add a controller button apart from the keybutton "space"?

    • @bubbaboogsvr
      @bubbaboogsvr 2 หลายเดือนก่อน

      @@guille_sanchez 2 years late and i know you don't need it now, but it's GetButtonDown instead of GetKeyDown

  • @BluePhantomGames
    @BluePhantomGames 3 ปีที่แล้ว +8

    Hipity Hopity Your knowledge is now my property 😎

  • @markusdevs4773
    @markusdevs4773 4 ปีที่แล้ว +10

    I made a two-month break from making games because I was overwhelmed with the school work and other things I had to do and now when I got back to it I totally forgot the syntax for C# and I was laughing at myself in front of vs screen for 10 minutes straight.

  • @phutureproof
    @phutureproof 6 ปีที่แล้ว +1

    Can't believe how long I've been trying to figure this out just to see it put very clearly in this video, well done sir you earned a sub

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +2

      Thanks for the support :) ! I'm really glad the video helped you out !

    • @phutureproof
      @phutureproof 6 ปีที่แล้ว +1

      Hey thanks for the

  • @Fran3Designs
    @Fran3Designs 4 ปีที่แล้ว +1

    This is incredible well explained, I can notice how much you edit the video to keep it clean and short, but at the same time with a lot of information. Thank you very very much.

  • @denislavkaragiozov5876
    @denislavkaragiozov5876 5 ปีที่แล้ว +2

    Awesome buddy, thanks for doing this video it made the jumping much more interactive and having such a feature adds a bonus layer to the plain action of jumping !

  • @DrFross09
    @DrFross09 5 ปีที่แล้ว +8

    Thank you for making this video. After implementing this code i noticed that the character would do sort of a mini double jump when ascending, I also see this replicated in the beginning of your video. after playing around with the values I found it best to actually set the initial jump as the Max height, and while jumping, instead of adding force when the jump button is held, you'd want to subtract (add a negative) force when the jump button is not held (I added an additional line that would stop the subtraction when I fell below a certain Y velocity, just so i'm not pulled down any faster)
    the result is more seamless jump, But again I thank you for making this video. I would not have come to this point, if it weren't for you.

    • @adamantal9129
      @adamantal9129 5 ปีที่แล้ว +2

      I was thinking the same, as it's also a much easier method, that instead of increasing the height while the button is down, just simply increase the gravity to fall faster or add a new force to push down the character when the key is released. But it kinda gives a different feeling to the jump.

    • @360spider06
      @360spider06 4 ปีที่แล้ว

      im trying to test this ut can you show me how you did it cause im doin this rb.velocity = new Vector2(rb.velocity.x, jumpHight - =1);

  • @stealthy1223
    @stealthy1223 3 ปีที่แล้ว

    Included almost everything I needed for the movement in 1 vid. thanks!

  • @Broockle
    @Broockle 4 ปีที่แล้ว +7

    nice tutorial,
    I was actually hoping to get some advice how to animate a jumping animation that uses this system.
    The hollow knight main character has a jump up and jump down animation followed by a falling and then landing animation I think.
    And it adapts to the height of the jump.

    • @itschiru
      @itschiru 3 ปีที่แล้ว +4

      You can use a transition using float and do that that float is equal to velocity.y now if is greater than a velocity playa another animation

  • @MrFlamingpride
    @MrFlamingpride 6 ปีที่แล้ว

    Masterful. Thank you sooooo much. You taught me how to use timers correctly in this tutorial too! Now I'll try making a charge shot like in Megaman!

  • @rauljerilara
    @rauljerilara 2 ปีที่แล้ว

    I really enjoy your videos every time I want to do something new. Thank you!

  • @drunkengaming4782
    @drunkengaming4782 3 ปีที่แล้ว

    Thank you for this video.. I was following a tutorial while making my own "Wario land 3" and obviously, it had that Mario jump mechanic.. so I've decided to start again with everything I learned but rather than blindly follow tutorials, I'll use this as my base and the rest I'll use what I learned on the way😘

  • @Gameoverpty
    @Gameoverpty 5 ปีที่แล้ว

    Perfect, this help me a lot with some things, i have 2 weeks learning unity, so thank you!

  • @palewine
    @palewine 4 ปีที่แล้ว +2

    It would be more efficient to check if the player is grounded when you hit the Jump button (in the "if" condition), rather than checking every single frame whether it's needed or not.

    • @SMT-ks8yp
      @SMT-ks8yp 3 ปีที่แล้ว

      But what if you need to check for ground the moment you landed? Like, to set animator triggers. Hmmm, guess then I can do it through function which is called OnCollisionEnter. This would still generate unwanted callback for whatever collider was not ground, but which is more expensive?

  • @cakerama
    @cakerama ปีที่แล้ว

    tysm, Ive been trying to figure this out for a while. every thing you said made sense and worked out perfectly. :)

  • @captaintany4133
    @captaintany4133 ปีที่แล้ว

    Bro you saved me so much time. Thank you and super simple and great tutorial by the way.

  • @gioeledallapozza5824
    @gioeledallapozza5824 5 หลายเดือนก่อน

    I'm trying to implement this in the wall jump too, it would be great if you made a video about it!

  • @FakemonFactory
    @FakemonFactory 5 ปีที่แล้ว +1

    like everyone else I REALLY considered giving this up... bless you

    • @DrFross09
      @DrFross09 5 ปีที่แล้ว

      Never give up, trust your instincts.

    • @sipsopgamera7624
      @sipsopgamera7624 4 ปีที่แล้ว

      @@DrFross09 My instincts is telling me to give upp

  • @vlakitus
    @vlakitus 6 ปีที่แล้ว +2

    Great tutorial! Exactly what i'm looking for!
    Can you please make a tutorial for wall jumping?

  • @OlivierPons
    @OlivierPons 5 ปีที่แล้ว +3

    Why is the reason you use feetPosition + manual "OverlapCircle" instead of using Unity colliders + OnCollisionEnter() and OnCollisionExit()? Maybe at the time of writing you didn't know about it, or is there an optimisation reason?

  • @VaneTheLocal
    @VaneTheLocal ปีที่แล้ว +1

    Here's a tip for better movement....
    On the player, set the "Linear Drag" to a greater value.... in the player script, instead of using" rb.velocity = ...." use "Rb.AddForce(*direction* x *small value*)"
    I bet there's one little problem now, the jump....
    To fix this, go to player script, and check if the feet object overlay is not colliding, if so set normal values of rb, if not, set the "Linear drag" to a greater value

    • @TiaCam-mg1ht
      @TiaCam-mg1ht 7 หลายเดือนก่อน

      thank you so muchh

    • @VaneTheLocal
      @VaneTheLocal 7 หลายเดือนก่อน +1

      @@TiaCam-mg1ht thanks for the response! Although I dont do game development now (I do 3d Modeling) im still happy to help!

  • @DawnosaurDev
    @DawnosaurDev 6 ปีที่แล้ว +2

    I believe you can also use scale to flip by setting it to -1
    Really interesting video never thought it was that easy

    • @TheCivildecay
      @TheCivildecay 6 ปีที่แล้ว

      thought that was the goto solution for any 2d sprite based game haha

  • @danivalentine1280
    @danivalentine1280 4 ปีที่แล้ว +2

    This is old, but you should definitely keep Inputs in Update instead of Fixed Update because sometimes the game won't catch the Input quick enough. Great tutorial though!

    • @danivalentine1280
      @danivalentine1280 4 ปีที่แล้ว

      @Gabriel Gatea no problem! It fixed the jump for my game as well haha

  • @shadowyt6038
    @shadowyt6038 4 ปีที่แล้ว +40

    *To anybody who needs the scipt for his character controller :*
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class GhostController : MonoBehaviour
    {
    private Rigidbody2D rb;
    public float runSpeed;
    public float jumpForce;
    private float moveInput;
    private bool isGrounded;
    public Transform feetPos;
    public float checkRadius;
    public LayerMask whatIsGround;
    public float jumpTimeCounter;
    public float jumpTime;
    public bool isJumping;
    void Start(){
    rb = GetComponent();
    }
    void FixedUpdate(){
    moveInput = Input.GetAxisRaw("Horizontal");
    rb.velocity = new Vector2(moveInput * runSpeed, rb.velocity.y);
    }
    void Update(){
    isGrounded = Physics2D.OverlapCircle(feetPos.position, checkRadius, whatIsGround);
    if(isGrounded == true && Input.GetKeyDown(KeyCode.W)){
    isJumping = true;
    jumpTimeCounter = jumpTime;
    rb.velocity = Vector2.up * jumpForce;
    }
    if(Input.GetKey(KeyCode.W) && isJumping == true){
    if (jumpTimeCounter > 0){
    rb.velocity = Vector2.up * jumpForce;
    jumpTimeCounter -= Time.deltaTime;
    }else{
    isJumping = false;
    }
    }
    if(Input.GetKeyUp(KeyCode.W)){
    isJumping = false;
    }
    }
    }

    • @angrygeri7026
      @angrygeri7026 4 ปีที่แล้ว +2

      Ahh yes, I am a game developer now.
      As good as someone called YandereDev.

    • @shadowyt6038
      @shadowyt6038 4 ปีที่แล้ว +1

      @@angrygeri7026 uh...? Do you mean that this was helpful?

    • @angrygeri7026
      @angrygeri7026 4 ปีที่แล้ว +1

      @@shadowyt6038 It wasn't, because I read the comments when I finished the video, but you definitely will help other people! 👍

    • @shadowyt6038
      @shadowyt6038 4 ปีที่แล้ว +1

      @@angrygeri7026 :) btw i wasn't really TRYING to help any people, when i was just trying to understand code, i copied into visual studio code, then i just thought i'd be helpful if i put it down in the comments.

    • @angrygeri7026
      @angrygeri7026 4 ปีที่แล้ว +2

      @@shadowyt6038 Lol.
      I always try to unserstand every line and when I don't, I Googls what it means and write it down in my little notebook

  • @ArkThaCreator
    @ArkThaCreator 6 ปีที่แล้ว

    thankyou for the tuts! i cant use unity, currently i use animate CC and AS3 but you help me in alot of ways with it! thankyou very much keep it !

  • @jehramdavejara2086
    @jehramdavejara2086 4 ปีที่แล้ว +1

    Hi Great Tutorial and clear articulation. im very new to unity i managed to recreate the code in my project. My question is can it be combined with the previous tutorial's double/triple jump mechanics? can I just copy the lines or do i have to tweak some lines specifically ? thanks

  • @winb_
    @winb_ 6 ปีที่แล้ว +1

    Very good turotial! I do also have a video suggestion, could you make a tutorial on inventory systems, I've been looking on youtube but all I can find are unfinished tutorial series and although Brakeys' tutorials are good, they seem kinda complicated as I was just looking to use a simple inventory system in a 2d game, but then I thought about you and your great way of making concise and straight to the point videos so I thought I'd leave a comment. Thanks again for all your helpful videos! :)

  • @mokeeh4821
    @mokeeh4821 6 ปีที่แล้ว +2

    Hi Noa, great video as always! I was wondering if there is a chance of you making a tutorial (series?) about 3D character movement? Having mainly 3D platformers in mind such as A Hat in Time, Yooka Laylee and such. Keep up the great work, you're a fantastic educational resource and a great teacher :D

  • @bltsevdallarfanclub641
    @bltsevdallarfanclub641 5 ปีที่แล้ว

    Best 2D Movement Tutorial of all time

  • @kimen1
    @kimen1 6 ปีที่แล้ว +3

    Cool! Part 2 of the video: how to accelerate & jump between walls like in super meatboy.

  • @oliverdepp4731
    @oliverdepp4731 6 ปีที่แล้ว

    I tried the brackyes code but that didn't work out, but yours did. You're awesome!

  • @alialsubaie8529
    @alialsubaie8529 6 ปีที่แล้ว +2

    I love your videos and hope to see more. Quick question, I noticed that you implemented the jump (change in velocity) in the update (not fixedUpdate) method, why? I've seen this in many other videos as well.

  • @ravature6577
    @ravature6577 3 ปีที่แล้ว

    This is exactly what I was looking for!

  • @ioanefeiqrishvili1617
    @ioanefeiqrishvili1617 6 ปีที่แล้ว +3

    Very good tutorial but why you are detecting input in fixedupdate? You have to detect input in update cause it's more faster and than move if rigidbody attached in fixed update!

  • @demoa0414
    @demoa0414 2 ปีที่แล้ว

    Thx so much it was so helpful i was trying to do some player movment but it always give an error💔😂 horizontal input is not setup something like that but that code worked so well thx👍👍👍

  • @LawMasterTimmy
    @LawMasterTimmy 5 ปีที่แล้ว

    You are so so so amazing. Thank you so much for putting your time into this tutorial, and all your other ones as well.

  • @notlight4968
    @notlight4968 3 ปีที่แล้ว

    This video is underrated, bro you are the best

  • @NelsonZavala0509
    @NelsonZavala0509 5 ปีที่แล้ว +3

    Hi Noa, Hey is there a video that show how to move and animate the player left or right but also play a Walk, Run and Sprint animation depending of the moveInput value ? for example if
    moveinput between 0.010 to 0.030 then play the Walk Animation and apply a Low force to the Right or Left
    or
    moveInput between 0.031 to 0.060 then play the Run Animation and apply a Medium Force to the Right or Left
    and
    moveInput between 0.061 to 1 then play the Sprint Animation and apply a High Force to the Right or Left

  • @mreverything7056
    @mreverything7056 4 ปีที่แล้ว +1

    Great turtorial, but you should make sure to multiply your movements by time.deltaTime, or you should put the physics in the FixedUpdate region (saying this because I did the turtorial just like this, and got a bug)

  • @destroyer9241
    @destroyer9241 2 ปีที่แล้ว +1

    Great video helped a lot

  • @cleanshirtlabs9620
    @cleanshirtlabs9620 5 ปีที่แล้ว +5

    What kind of color scheme are you using in your visual studio? Looks cool :D

    • @Zayther
      @Zayther 5 ปีที่แล้ว +1

      It is not visual studio actually! He is using another code thingie (Idk terms XD)

    • @fruity7886
      @fruity7886 4 ปีที่แล้ว +1

      @@Zayther are you sure it definitely does look like visual studio

    • @Zayther
      @Zayther 4 ปีที่แล้ว +1

      @@fruity7886 I'm sure a least in this video

  • @Gooseguy1000-1
    @Gooseguy1000-1 2 ปีที่แล้ว

    I appreciate that you made this video. Thank you very much.

  • @pacocu9839
    @pacocu9839 4 ปีที่แล้ว

    Great way of teaching :) I liked a lot your game at the GMTK 2020 btw

  • @rohanpatel2608
    @rohanpatel2608 6 ปีที่แล้ว

    You can also multiple (-1) to the local scale to flip the player!!

  • @waterfallbw
    @waterfallbw 6 ปีที่แล้ว +2

    Also, Blackthornprod, thanks for playing my game. I'm TheMonoMew from discord (with the smash bros type game)

  • @DuKeJooJs
    @DuKeJooJs 6 ปีที่แล้ว +7

    I really want to use it, but i'm having a little problem, if i press jump many times quick, sometimes the character do a "Double Jump", how can i solve it?

    • @jankozorbas
      @jankozorbas 5 ปีที่แล้ว

      I'm having the same problem, did you maybe find a solution?

    • @adamantal9129
      @adamantal9129 5 ปีที่แล้ว

      @@jankozorbas have you tried to add "&& isJumping = false" to if(isGrounded == true && Input.GetKeyDown("Jump")) like this: if(isGrounded == true && Input.GetKeyDown("Jump") && isJumping = false)
      haven't tried it I will do so later

    • @johku433
      @johku433 5 ปีที่แล้ว

      @@adamantal9129 did it work?

    • @adamantal9129
      @adamantal9129 5 ปีที่แล้ว

      Yes, it's working

    • @ARTHUR14523
      @ARTHUR14523 4 ปีที่แล้ว

      That's happening because you have a very large radius on check radius so if you manage to press the space so quick the radius is still touch the ground.
      Try a smaller number on check radius instead.

  • @TheGrandBagel
    @TheGrandBagel 5 ปีที่แล้ว

    Followed along, not sure if a year makes a difference but by the end, I couldn't move while jumping, adding the horizontal movement code in with the if(JumpTimeCounter > 0) fixed it

  • @patrickvonallworden6152
    @patrickvonallworden6152 4 ปีที่แล้ว +1

    thank you so so much for the nice tutorial

  • @viendoronila6595
    @viendoronila6595 4 ปีที่แล้ว

    Thank you, BlackThornProd. I've been having problems with my feetCollider(BoxCollider2D) and bodyCollider(CapsuleCollider2D). Basically my game's player has two colliders, one for checking the ground and one for the body to detect damages from an enemy. The huge problem was there's an edge that intersects the bottom of the capsule and the top of the box, so whenever I jump at platforms within jump reach, I tend to get stuck at the sharp edge of my platforms. I tried to fix it using Custom Physics Shape by turning my sprites' sharp edges to 45°. Nothing worked so I have to eliminate the box collider somehow, then I found this. Thank you again :>

  • @utkugokalp3179
    @utkugokalp3179 6 ปีที่แล้ว

    I was waiting this video from you, thanks very much :)

  • @worldrevealed1897
    @worldrevealed1897 6 ปีที่แล้ว

    great tuto. should've add faster fall down after jump for more smoother jumping

  • @JohnWeland
    @JohnWeland 6 ปีที่แล้ว

    Awesome video! I'd love to see how to make a screen to configure input controls (keyboard mouse and controller). So a player can go in and configure inputs.

  • @olej_500
    @olej_500 6 ปีที่แล้ว +3

    Hey @Blackthornprod i love your videos, they helped me A LOT in implementing various things but im currently strugling with trying to make a walljumping. The biggest problem is setting the player velocity through the GetInput.Axis. Do you have any ideas on how to make it work? Cheers :)

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +1

      Hey Peter :) ! Sorry for the late reply ! I may very well make a wall jump tutorial in the near future, I'm sure it will help you out :) Stay tuned !

    • @olej_500
      @olej_500 6 ปีที่แล้ว

      Blackthornprod No worries man i got it working quite fast anyway :P but still i think it is a good idea for a tutorial. Once again love

  • @ferdc2916
    @ferdc2916 4 ปีที่แล้ว

    Superb tutorial. Do you have any with animation?

  • @60quadros32
    @60quadros32 3 ปีที่แล้ว

    Your tutorial is great.

  • @armandviljoen2848
    @armandviljoen2848 6 ปีที่แล้ว +2

    Can you please do a video on how to animate in unity like your cube for instance, moving up and down in idle, did you export a file from PS as shown on previous videos or is this only animated in unity? I struggle with Idle animations

  • @devmarboy4045
    @devmarboy4045 2 ปีที่แล้ว +1

    I need help when I hold the jump button my character stays in place till the timer stops then it starts moving again

  • @jacquesdebruin4839
    @jacquesdebruin4839 2 ปีที่แล้ว

    Thanks for the help. I whould recomend going a little slower but other tham that grait job

  • @BEPPEJHA
    @BEPPEJHA 6 ปีที่แล้ว

    Really really well made tutorial !

  • @roundishwhale
    @roundishwhale 3 ปีที่แล้ว

    Lovely tutorial, thank you so much^^

  • @eriknastesjo843
    @eriknastesjo843 5 ปีที่แล้ว

    Awesome! Now is there a video about accelerated movements as well, I wonder?

  • @ZeroChronicles01
    @ZeroChronicles01 5 ปีที่แล้ว

    I love this tutorial so much, much better then the last one ! ^_^ only problem I had was my camra was also flipping as well? My camra is set to follow my character. Any tips?

  • @rofeldayao2972
    @rofeldayao2972 5 ปีที่แล้ว

    This is a great tutorial, there's bit of a problem thoug. While attacking and long jumping character won't move anymore it just keeps going higher until it reaches the end of the jump

    • @wercole
      @wercole 5 ปีที่แล้ว

      I found the same problem.

  • @nabjnabjev
    @nabjnabjev 6 ปีที่แล้ว

    *I LOVE YOUR TUTORIAL!*

  • @uma_sankar
    @uma_sankar 6 ปีที่แล้ว

    Awesome Video, Looking for more videos like this.Keep Going !!!!

  • @omerseyfettinbekar2780
    @omerseyfettinbekar2780 4 ปีที่แล้ว

    thanks for video this is so much helpful i am new at game developer and i try to find stop jump animation and how turn my swordman left i found this in your videos thank you
    Sorry for english i am new in this,too

  • @613Omar
    @613Omar 5 ปีที่แล้ว

    Blackthornprod really nice video, this is a "most-wanted" mechanic. One question... why the left/right movement on Fixed but the up/down on Update, both are afecting the rigidbody... ¿shouldn both be on fixed?

  • @palewine
    @palewine 4 ปีที่แล้ว

    Thanks, this is very helpful.

  • @randomoriginality9670
    @randomoriginality9670 3 ปีที่แล้ว

    thank you, I have no other words.

  • @yairv13
    @yairv13 4 ปีที่แล้ว

    Thank you so much for all your videos man!
    Is there a chance to get a link to this tiny project?

  • @yesidsalcedo202
    @yesidsalcedo202 5 ปีที่แล้ว +2

    hermosos tus tutoriales

  • @AsasinoManik
    @AsasinoManik 5 ปีที่แล้ว

    Thank you so much😰😫😭😂
    I am crying you really solved my problem

  • @nicklasl7973
    @nicklasl7973 3 ปีที่แล้ว

    Thank you very much!

  • @weneedmorepowertobecomestr4591
    @weneedmorepowertobecomestr4591 6 ปีที่แล้ว +1

    Thank you so much bro

  • @mariusbarbu1268
    @mariusbarbu1268 ปีที่แล้ว

    Thank you for the video! It really helped me out.

  • @mhack071099
    @mhack071099 6 ปีที่แล้ว +1

    Dude , you are a blessing , keep the good work ! 👍

  • @quangcaonhat5860
    @quangcaonhat5860 ปีที่แล้ว

    Thanks for your content, It's help me a lots

  • @havendewart
    @havendewart 4 ปีที่แล้ว +1

    Add a constraint on z under rigid body so the player does not rotate.

  • @محمدترابی-ق2ب
    @محمدترابی-ق2ب 3 ปีที่แล้ว +4

    hello.
    my iran
    thank of Education you.
    very Good

  • @tharanios2501
    @tharanios2501 6 ปีที่แล้ว

    Nice tutorial man!❤️

  • @ianteixeirapessoa9294
    @ianteixeirapessoa9294 9 หลายเดือนก่อน

    thank you man, u are a great person

  • @ayedabboushi7221
    @ayedabboushi7221 4 ปีที่แล้ว

    Many thanks Noa

  • @FowlArtemis2nd
    @FowlArtemis2nd 6 ปีที่แล้ว

    Thank you for this!!

  • @auscan7739
    @auscan7739 3 ปีที่แล้ว +10

    if you guys get confused by the order of the curly bracket here is the symmetrical one for the jumping:
    if (isGrounded == true && Input.GetKey(KeyCode.Space))
    {
    isJumping = true;
    jumpTimeCounter = jumpTime;
    buttonPressed = JUMP;
    rb2d.velocity = Vector2.up * jumpSpeed;
    }
    if (Input.GetKey(KeyCode.Space) && isJumping == true)
    {
    if (jumpTimeCounter > 0)
    {
    rb2d.velocity = Vector2.up * jumpSpeed;
    jumpTimeCounter -= Time.deltaTime;
    }
    else
    {
    isJumping = false;
    }
    }

    if (Input.GetKeyUp(KeyCode.Space))
    {
    isJumping = false;
    }

  • @barkmober
    @barkmober 2 ปีที่แล้ว

    If you are having problems with character stuck on walls just put a no friction physics material

  • @MADagain
    @MADagain 4 ปีที่แล้ว +1

    The code works, though I've noticed that when I hit an edge whilst holding a direction the player is able to stick to the wall/ground

    • @gk1460
      @gk1460 4 ปีที่แล้ว

      Same, found solution?

    • @luisjoia9744
      @luisjoia9744 3 ปีที่แล้ว

      @@gk1460 still want the solution?

    • @gk1460
      @gk1460 3 ปีที่แล้ว

      @@luisjoia9744 nope, I fixed it, thanks:)

    • @santyagraz6226
      @santyagraz6226 3 ปีที่แล้ว

      @@gk1460 what was the solution?

    • @miguelarthursla
      @miguelarthursla 3 ปีที่แล้ว +1

      add a 2D Physics Material to your Player's Rigidbody and then set the Physics friction to 0