Dash and After Image - 2D Platformer Player Controller - Part 8 [Unity 2019.2.0f1]

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ม.ค. 2025

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

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

    dude! what a beautiful tutorial. I hadn't been watching this series before, and these scripts were still so adaptable to my game. Got it up and running in no time! thank you so much!

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

      Glad to hear it! :D

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

    object pooling is the coolest idea I have heard of since after my data structures class

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

    Very informative set of tutorials. Thank you for making the time to put this all together. The one bit it took awhile to get my head around was the GetObjectFromPool method which was returning a GameObject in the method call but we didnt create a reference to it in the calling function which seemed counter intuitive. Then I realised that we are just bringing the object to life by setting it as active. Surprised the compiler didnt moan through! Anyway - enjoying the series - so thanks again.

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

    You're an absolute legend, helping us out big time with refining our controller. Once we release I'll be sure to mention your Patreon. Keep up the great work!

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

      Glad to help! Also feel free to share your progress and game when it comes out on the discord server! Would love to see it :)

  • @mr.casual2304
    @mr.casual2304 4 ปีที่แล้ว +2

    Omds this works amazingly and it was easy to understand, informative and pushed my knowledge of game dev. Cant lie i had to check if i was on x1.5 speed like 4 times cuz you were fast.

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

      I'm glad that you could still get something from it even though the editing made it a thousand times faster than it should have been! Sorry about that. After part 11 or so I change back to a normal way of editing where people can actual follow along. But thank you for the feedback I really appreciate it :D

    • @mr.casual2304
      @mr.casual2304 4 ปีที่แล้ว

      @@Bardent its fine and No problem. Also do you have anything on horizontal movement dampening

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

    This video is exactly what I've been looking for for a long time

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

    To people having trouble with the dash now, you need to set your Dash button to "Key or Mouse Button", I also went through and made sure i didnt have any debug Keys bound to left shift

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

    This was so well explained, thanks a bunch man. I already had a dash made with a coroutine. I really didn't think about this method before. But the after image worked like a charm, thanks again.

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

    Man! this channel is so underrated! This deserves so much views and likes! This is exactly the kind of dash I've been looking for ever since I started working on Shikari Rising. I needed to indicate the distance of each after image and not just rely on time.deltatime to do it every x amount of seconds :'D Thanks bro! cheers!

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

      Thank you I really appreciate that :) just a heads up I did miss something in the player after image script itself with delta. Just where we decrease the alpha. We need to link that with delta time :)

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

      @@Bardent right, thanks a lot!

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

    This is saving my ass right now :) Thank you so much. I can't believe this doesn't have more views.

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

      I'm really glad it helped you! Hopefully one day it will XD

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

      @@Bardent I will recommend this to everyone that needs help with getting their platformer set up! I study game development in college rn and this will be so helpful for everyone in my course. You're a hidden gem, much better than any tutorial I have seen so far honestly :) Thank you again for uploading this free to watch. Keep it up!!

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

      Awe that really means so much! I would love to have been able to go to school for this but self taught can be just as good :D and I'll keep sharing things as I learn it :D

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

    As promissed u re back

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

      Thank you! They went pretty well. It's good to be back :D sorry it took so long

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

      @@Bardent take your time, u deserve it

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

      @@Bardent ohhh btw, what's ur plan to this series, like after this dash what comes next? And after it, and after after after after it xd

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

      Cause i have a question i had a bow system working with the the player flip (beeing scaled -1) but since i started follow this much more completed tutorials, i cant use my bow script anymore because we are rotating the player -180 degrees, as soo when i shoot my arrows i cant make them flip facing the char direction

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

      Oh forgot to mention thar if i scale the player to -1 when fliping the wall slide and the wall climb just dont work like it is suposed to do @Bardent

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

    My brain exploded when i saw all your variables....guess I better start from the first video in the series!

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

      There is a lot here :D Beware parts 7 to 12 (I think) has a bad style of editing making the videos very fast. Bad life choices :( But after that I figured out how stupid I was being and changed it.

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

    Awesome editing and animation style. Thanks so much for the tutorial :)

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

    Dude, this is awesome as tutorials and it actually goes pretty in depth compared to most other material... I noticed that there a few bugs in the project however. First, you can (if you time it really well) change direction before the ledge climb script set the ledgePos1 resulting in the character climbing to the left if the ledge is to the right and vice versa (this gets fixed if I move CheckLedgeClimb() to FixedUpdate(), but then I get some jitter when climbing the ledge).
    Also, after you dash, you can do the same thing (change direction while ledge climbing). This seems to be because when you end the dash, you turn canMove and canFlip to true which overrides the behavior of the CheckLedgeClimb() function (this doesn't get fixed if moved to FixedUpdate())
    There is also something going on with gamepads... We use "GetButtonDown("Horizontal") for the turnTimer part but if I use a gamepad, it doesn't work and I can't wallJump.
    I noticed that you change to a FSM in the future, are those issue fixed since we no longer rely on bool to control the state ?
    Thanks,

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

    I like the computer science drop so much at the beginning of the video. Thumbs uped

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

    Warning: Check "Type" when making new Inputs, and ensure it says "Key or Mouse" (or desired output type).
    Mine for whatever insane reason decided to default to joystick so I was trying to find a code bug that didn't exist when it was a Unity default input creation flaw.....

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

    I could not understand why the new animation did not work, I found the reason.
    where we assigned a new key "Dash", go to input setting (Edit -> Project Settings... -> Input Manager -> Dash ) in the category Type, assign instead "Joystick Axis" to "Key or Mouse Button"

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

    Love your videos, this works so perfectly

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

    im really confused. You declare variables but when u scroll down theyre not there i got so confused at 11:10 because you didnt have the if statement u just made

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

      Your eyes are too sharp! Basically I noticed later I did the things in the wrong order so I tried editing it to follow the correct logic that it should. So don't worry I did not add or remove anything and not show it the timeline is just a little different. So if you follow what I am doing in the moment everything will be there. I have also now embraced mistakes like these instead of trying to cover them up with editing XD

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

    Edit: If you can't see the after image just go jump to part 11, he explain how to fix it at in the end.
    Idk why for some reason if I set the alphaMultiplier = 0.85f the after image is totally invisible. But if I increase the value alphaMultiplier to 0.97f I got the same result like you did

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

      Hey! Just check that we multiply the amount we decrease alpha by time.deltaTime. I forgot that and add it back later in the series :D

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

      @@Bardent Thanks for reply. Honestly I don't understand how to do that, but I keep following the tutorial and found it at Part 11 you explain how to fix it at the last minutes. So I suggest rather than just explain maybe you can give the code or you provide the link directly. Thank you! Amazing tutorial so far!!!

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

    90 seconds in, and I am very impressed with the video. Actually explaining object pooling with graphics is great, I have worked with it before on a bullet hell feature, using a YT tutorial, but still had no idea how it worked before watching this. Or why it is problematic to use destroy in your code.

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

      I'm glad it helped. I need to improve my animation workflow somehow because they take so much time I left them out of the last couple of tuts.. but I will include them in the new videos (they're gonna need them XD)

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

    Hey this is cool but what about some enemy ai?

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

      Soon :D

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

    You are cool drawing previews)

  • @claireglory
    @claireglory 4 หลายเดือนก่อน +1

    dash is not working for me too. i've read all the comments in this video to find the solution but nothing works. do we have to make a dash animation in animator? because that's the only thing i haven't tried yet.

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

    Hey man, this is an amazing tutorial, I loved all the information you shared!
    I have one quick question, I'm not sure if it has been asked before, I added a dash animation and for some reason I can't seem to get the animation to work, it plays the first frame of the dash animation and that's it, do you have any insight on this?

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

      I figured out my problem! I set the dash animation transition to come "from any state", which caused the issue, you can read more about it here: answers.unity.com/questions/724985/why-animation-only-play-first-few-frames.html
      Hope this helps the next person!

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

      @@marwanonthemoon876 Hey my friend! Speaking of that issue, do you have some idea to put a new animation to run, in the dash hold state? (I mean, the time when the arrow appear to release the dash direction) =)

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

    This channel is gold

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

    i might figure it out, but is there an easy way to make it so instead of only being able to dash left or right and on ground, to be able to air dash as well, and not just on the Xaxis but Y as well

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

    so im running into an issue where my character won move at all its getting the added force but it won't get the character movement from what i was told its the rigidbody.velocity is of the player movent script essentially overriding the dash command.

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

    I have a problem with Dash. Only when jump, works but without After image. I compared codes and I don't find differences.

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

      Same here. did u fix ?

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

    Hi. I found an issue with the jump part of the script:
    if you fall from a ledge by walking or dash, you can jump mid air same as a double jump and if you have double jump you can jump 2 times in the air.
    the reason is this part of the scrip:
    if (Input.GetButtonDown("Jump"))
    {
    if (isGrounded || (amountOfJumpsLeft > 0 && !isTouchingWall))
    {
    NormalJump();
    }
    else
    {
    jumpTimer = jumpTimerSet;
    isAttemptingToJump = true;
    }
    }
    I don't know how to fix it without breaking the double jump mechanic.
    EDIT: fixed it.

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

      to solve the issue I created a bool named "jumped" and made it true in the NormalJump().
      and added some if's in the CheckInput() as folows
      private void CheckInput()
      {
      movementInputDirection = Input.GetAxisRaw("Horizontal");
      if (Input.GetButtonDown("Jump"))
      {
      if(amountOfJumpsLeft> 0 && jumped == true)
      {
      NormalJump();
      Debug.Log("double jump");
      }
      if(amountOfJumpsLeft > 1 && jumped == true && isGrounded == false)
      {
      NormalJump();
      amountOfJumpsLeft--;
      Debug.Log("emergency jump");
      }
      if (isGrounded && !isTouchingWall)
      {
      NormalJump();
      }
      else
      {
      jumpTimer = jumpTimerSet;
      isAttemptingToJump = true;
      }
      }

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

    Didn't get the AfterImageSprite to show up until I changed from Update to FixedUpdate.
    Also had to reset the transform of the prefab.. (I think)

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

    Oh great tutorial mate keep going!

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

    I recommend adding a additional condition when check input for dashing: if(Input.GetButtonDown"Dash" && movementInput !=0) because it makes no sense when u can stay still in one place and still be able to dash imo.

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

      Lot of games like hollow knight and cuphead (popular so I'm using them as examples) have you dash whenever you want and honestly I think it's intuitive and should be able to dash while not moving too. Maybe it's just me? But hey it's your game go for it.

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

      Reply is a (little) late lol

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

    i've got this working in my own platformer but im confused about how to get more/less images. when i change the "distance between images" float it doesnt seem to do anything

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

      I have the same problem, did you manage to solve it?

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

      @@neravus sadly no!

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

    Hey man ,your tutorials are soo good . You explain very well . Please кeep up the good work ,because I want to learn from you. Thank you .

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

      Hey! Thank you so much! I will definitely keep it up :D

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

      From what you get inspired ? Sorry for the bad English .

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

      No worries :D For this project I am currently drawing a lot of inspiration from Hollow Knight and Dead Cells :)

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

      @@Bardent Nice ,me too and Ori and the BlindForest , .

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

      Also a really good game!

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

    Bro GREAT TUTS!! I have a question and it's that my player is infinite dashing even though the dash time is at .01. How can I change that??
    EDIT: Just forgot to add dashTimeLeft -= Time.deltaTime;

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

    why is my character flying sideways without stopping until i hit a wall when i dash?
    nvm i forgot to add: "dashTimeLeft -= Time.deltaTime;" its now working. Thanks for your Tutorials!

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

    i have a problem with the after image, its position on the z is -6977 and i cant change it, would you know why this is happening?

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

    where should implement the isDashing = false; in 13:11

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

      when creating the variable. "private bool isDashing = false;"

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

    awesome tuturial, keep going

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

      Thank you!

  • @studiomonster-c9l
    @studiomonster-c9l 4 ปีที่แล้ว

    amazing work!!

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

    Please we need more videos on this! You are amazing you have helped me a lot to start off making my own game. You should add enemies. And create a meele attack system. Also sound effects on moves

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

      Sliding movement, slopes??? Boss system, if you make this an actual complete course you’d help a lot of people bro keep going

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

      Awe that makes me feel so good thank you! I'm working on enemies and combat systems now :D will get it out as soon as possible but it might only be after Christmas. Good luck with your own game! Definitely show it off on the discord server I would love to see it :D

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

      @@Bardent i joined the discord i have a problem at the moment that was just created out of nowhere hope you could help me!! i shared it on the i need help chat :)

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

    Small question. I have realized that the object pooling keeps generating new copies of the sprites instead of enabling and disabling the already existing ones. I wrote everything to the letter but i still get that "error". Any suggestions on what am i doing wrong.
    Great tutorial by the way!

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

      Instead of instanceToAdd.transform.setParent(transform); try instanceToAdd.transform.parent = transform;

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

      @@LoomMexatron Thank you but apparently i am stupid and i wrote if (timeActivated >= (timeActivated + activeTime)) instead of if (Time.time >= (timeActivated + activeTime)).

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

    Handsome Bardent

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

    Hii!! Love your Series, please keep making more! I would love to learn more about meele attack, combos, animation frame cancelling and transition back into idle state. I would also like to learn about state machines. Recently started Unity from GameMaker and am a little confused so far. Thank you very much!

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

      Literally what I'm busy working on so expect that to come next :D

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

    My after image alpha is always at 0 so you can never see the image does anyone know how to fix

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

    the afterImage sprite of my character is really small and flipped how can i correct this?

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

      Hey! If your character is scaled then in your after image sprite script you can say "transform.localScale = player.localScaled;" Something like that :)

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

    A great series Bardent! I have a question regarding resetting the dash cool-down. How would you go about resetting the dash once you are on the ground. So for example you can jump and dash only once whilst its on cooldown, but when you land back on the ground it allows you to dash again. Similar to how Celeste does it!

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

      Hey man! So can you dash while you are grounded? Are you on the discord?

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

    Het Bardent, Don't know why my dashing is not working I followed all the steps . Please Help
    for future new commer if its not working with zero error just change the input of Dash from left shift to other

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

      Check "Type" when making new Inputs, and ensure it says "Key or Mouse"

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

    Ok so all your tutorials up to this point had been incredibly good, but here you're in such a rush that it literally gave me a headache trying to follow along, even pausing. and I kept making mistakes and having to scroll back to see what I missed... ugh...

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

      Heya! Yeah I completely agree that these parts are bad in that sense. Don't worry not all the parts are like this moving forward. Only the next couple. My recording situation changed for a while and I had to sit in a closet with just my microphone to get any usable audio so I had to write out a script before hand and try to match a recording of the code with it. Apologies!

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

    amazing Tutorial!! ty so much

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

    yay a new video!

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

      ❤️

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

    For some reason my afterimage sprite has a green hue to it and doesn’t fade but rather just disappears? Help?
    PS. This tutorial is very good, thank you

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

      Solved: with unity 2020.1.0 where colour is set it takes 3 inputs and then alpha, so it would be: color = new Color(1f, 1f, 1f, alpha);

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

    Hey Bardent! That was a really beautiful tutorial. One thing I noticed though is that it seems the "lastDash" variable you declared isn't affecting the game anyhow. Is there a particular reason it was declared? Or I'm I missing something? Thanks!

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

    what is this at 11:09 .. you write a line and then its gone... huh?

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

      Yeah sorry about that. It's just edited so the code flows better but I recorded it in the wrong order

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

    the tutorial series at the beginning where super. you could watch and parallel write the code as you dictated...but with time the videos got faster and faster and faster, so i neede to pause thousand times. and now i got so much errors and dont know why :D the dashing does not work. it would always be good to make a seperate project version for every video so everybody could download it and watch the code. now i have to watch everything from the begining and look where i made a mistake. :-/

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

      Yep sorry about that too. When I made these episodes my recording situation didn't allow me to code and talk at the same time so I had to record the video and audio separately. I have switched back to the way the first couple of episodes were now for the last couple of parts. If you need any help with the code feel free to come on the discord and we can help you :D

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

      weird. watched whole video again, checked my code and it doesnt work :-(

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

    AHhhhhh nice :D just finished the new part and I like it. Maybe a bit too fast some times, but maybe I am just too slow.
    One question : I like the dash more, if the player doesn't fall, so i changed the y velocity to 0. But now the falling animation doesn't start if the dash ends mid air. Do you have a suggestion?
    PS: Have a wonderful day :P

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

      Yeah sorry about the speed issue. With my current recording situation I can't record the audio and the tutorial at the same time so I do it separately and I tend to talk a bit fast when I am not working at the same time. Will definitely slow it down a bit more next episode :D Hmm it's really weird that the falling animation doesn't start because I just set mine to 0 to test it and the animation still switches. I'm guessing on of the animation booleans are not getting set. Maybe try doing the dash and then go into the animator and check the status of all the booleans and see if they are all what they should be. If you want to send screen shots and get help a little quicker feel free to join the discord :D I'll still help you on here though

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

    Do you ever assign a value to distanceBetweenImages?

  • @uhhh...
    @uhhh... 2 ปีที่แล้ว

    can someone help me, when i dash on air... its penetrates the wall in front of it, but if during dash on ground it doesnt penetrate it. whats the solution for this problem penetrates on the wall while dashing on air?

  • @AnhinhHoang-yx3ft
    @AnhinhHoang-yx3ft ปีที่แล้ว

    when i dash my game screen suddenly freezes and it can't work at all? can you help me ?

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

    thanks for the great tutorial , except i cant really find the script on the link that u putted in the description , there is no part 8...

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

      Hi! Yes sorry I forgot to add that one to the uploaded files but everything should still be there in the later part :D Sorry about that :(

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

    Love the videos, very late comment though. Wouldn't it be easier to use the unity trail renderer instead of having to use prefabs and instantiation? Im not sure the way unity engine does it, but i do think it would be less resource intensive.

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

      Hmm I have not considered using a trail renderer for that but because we are using already created objects and then reusing them instead of destroying them this approach is not very resource intensive at all :D Using object pooling we could handle a lot more objects in this way :)

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

    man... this is the second time i have to stop and control Z everything i did because I cant implement your canMove or CanFlip functions because i used so much diferent code than yours i have no idea where to put the canMove thing.

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

    Really awesome feature for the game. But i have a question, plz help me to answer it because i don't know your code well. Usually, a game with character moving would have speed multiply to Time.deltatime but i don't see it in your code. I wonder if your game needs it or not.

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

      Thank you! I see what you mean and I do see that a lot as well. So in this case seeing as we are setting the velocity to something constant we don't need to multiply it by time.deltaTime. If we were to add something to the velocity e.g we said velocity += 10 we would need to multiply the 10 by delta Time to account for variable frame rate unless we did it in FixedUpdate. Idk how good my explanation is but feel free to hop on discord if you have more questions. I would be more than happy to try and explain what I know more. You can also ask here if that's easier for you :D

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

    I love it!!! ❤

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

    has anyone had a bug where your character gets stuck aginst the wall unable to move or jump?

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

      Hey! You need to add a zero friction physics 2D material to your character :)

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

    Hey can u pls make a tutorial of dash disabling gravity so that the player can dash in 1 straight line like in celeste PLS

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

      just make the rb.velocity.y 0 in your checkdash function

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

      @@feelgxxd thanks bro u are a life saver

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

      @@devanshkumar4729 you are welcome brother, always

  • @BoogeyMan-fu5yn
    @BoogeyMan-fu5yn 4 ปีที่แล้ว

    how did you make the dash input? If it was through Input manager how did you do it????

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

      Hey! So I make the input at 8:57.

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

    Great tutorial, the script works really well but my character won't stop dashing unless if I release the button.

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

      hmm double check your cooldown check :)

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

    Thanks for the all tutorials. These may be the most detailed courses on the internet. But i have a problem. I can't make dashing and after image work. I think i properly follow all the steps shown in the video but no luck ? When i press dashing button i set in unity nothing happends no error message in unity console, everything else exept dash and after image everthing works fine ?

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

      Merhaba, sorunu halledebildin mi ?

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

      @@RRaidyn Kısmen. Unity ayarlarından eklediğim dash komutunda bir problem var. Sanırım beta unity kullandığım için bir bug. İf'li dash kodunu" if (Input.GetKey(KeyCode.E))" şeklinde değiştirirsen aynı sorunu yaşıyorsan geçici olarak çözecektir. Dash E tuşu ile çalışıyor .

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

      @@mustafayildiz5251 Düzelttim bende teşekkürler. Climb bölümüne geçtim. Orayı yaptın mı ? Benim karakter Ledge climb da duvarın içine takılıp kalıyor şimdi de. Çok fazla kafa yordum, başım ağrımaya başladı artık. Çözemedim bir türlü...

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

      @@RRaidyn O pronlemi ben de cozemedim. Bu eski player controler tutoriali. Enemy ai videolarindan sonra yeni bir player controller serisi var. O seride o problem yok diye biliyorum. Problem collision kaynakli ama net cozumunu bilmiyorum

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

      @@mustafayildiz5251Anladım bi göz atayım teşekkürler

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

    Idk if your still gonna answer But why time and not delta time?

  • @321dip
    @321dip 4 ปีที่แล้ว

    Hey my collisions are not getting detected correctly every time, by the composite 2D collider but when I change it to box it is detecting while dashing.

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

      Hey! Are you talking about the players collisions with the ground?

    • @321dip
      @321dip 4 ปีที่แล้ว

      No I mean, the player collision with the wall.

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

      If you are going through them when you dash just make sure you have collision detection set to continuous for the player on the rigidbody2d :D

    • @321dip
      @321dip 4 ปีที่แล้ว

      Thanks a lot. That worked. Great tuts by the way. Thanks a lot keep em coming.

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

    I tried everything and it doesn't work. I didn't even want the afterimage stuff, as long as I could dash, but I just can't make it work.

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

      Try to change Input.GetButtonDown("Dash") to Input.GetKeyDown(KeyCode.LeftShift) in CheckInput().

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

      Check "Type" when making new Inputs, and ensure it says "Key or Mouse"

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

    my thing is scaled to be small and if I put .localscale it becomes HUGE! what should I do? ( btw love ur channel, keep the AMAZING work up! )

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

    Hi, first of all, I tried to contact you from your Discord server, but I didn't get a response. There are no "Canmove" lines in my code. I just want to add Dash. When I write the codes in the video, my character can only dash through the air. He can't throw dash on the ground. I'm new to Unity & C#. I think I have to write something like this; if my character touches the ground, I have to add the condition. But I don't know how to do it. Do you have that might help ?

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

      Hey! I have replied to your message on discord. If that is not enough can you please go ahead and send me a DM with your code so I can take a look at it :D

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

      @@Bardent Thank you i see ur message now. I'm sorry if I was arrogant. I've been thinking a lot lately, and there's been a constant problem. And there are very few places where I can get help.

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

      @@RRaidyn yo, did u solve the issue?

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

    Hey I love your video. I'm having trouble when I dash towards left side the after images are facing the right side. How can i fix it. Please tell me or make a video on this issue.

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

      Hey! That's strange. Did you set the rotation in OnEnable?

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

      Hey thanks for the reply. I fixed by just flipping transforms localScale depending upon facing right or left.

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

    How to scale the after image? because my player is small (o.5 scale) and the after image is huge.
    Thanks! great video !

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

      Hey! If your character is scaled then in your after image sprite script you can say "transform.localScale = player.localScaled;"

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

      This worked for me, thank you so much

  • @Luna0864-v9i
    @Luna0864-v9i 4 ปีที่แล้ว

    Hey, thanks for the tutorial!
    Can you help me with something? :)
    So, how can I show the remaining time to use the dash again in the UI?
    I tried to use:
    public TextMeshProUGUI dashCoolDownText;
    dashCoolDownText.text = dashCoolDown.ToString();
    But it did not work, always show "5" all the time. Help me :(

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

      Hey! So yeah our dashCoolDown is constant. We determine if the cooldown is done by saving the dash start time, then seeing if Time.time >= startTime + dashCoolDown. So maybe you can set the text to startTime + dashCoolDownTime - Time.time. Then just clamp it to 0.

    • @Luna0864-v9i
      @Luna0864-v9i 3 ปีที่แล้ว

      @@Bardent What "startTime" float would be in our current tutorial script?

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

    After adding this to my controller the walljumping becomes 10 times more difficult to perform then if I didn't have the dash code.
    Getting rid of the checkDash method from either update method make the walljumping go back to normal. Any reason for this behaviour?

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

      nvm I solved it, I'm just kinda dumb ngl

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

      @@nibsnaf please tell me how you solved it, I have the same problem

    • @JB-zp1xt
      @JB-zp1xt 3 ปีที่แล้ว

      @@claudiu1716 did you ever fiund a solution? also having same problem

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

      @@JB-zp1xt no, I'm sorry

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

      kek

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

    How can I make the air dash stays in the air while the dash is happening? Like, Megaman games

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

      You will need to continuously set the y-velocity to zero :) So I believe in this video we made it so we don't affect the y-velocity, so just change that to 0 instead :D

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

      @@Bardent I did it and worked, but I can't jump while I'm dashing in the ground. How can I fix that?

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

    hey! Thank you so much for the tutorial; it helped me out a lot. I'm having a weird problem with the afterimages not flipping when I dash though. I've spent like 3 hours looking at the code and I think I'm stuck; any insight would be helpful!

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

      Hey! Are you using the same movement code as I am? In the afterimage script we have a line transform.rotation = player.rotation; That should orient the afterimage in the same direction the player is facing. If you are using a different method to flip the player, say setting the scale to 1 or -1 then you need to set that in the sprite script instead of rotation :)

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

      @@Bardent AHA! That was it exactly, thank you so much! Love the series, dude. I'm using my own controller but I love the way you organized the script. Suggested the series to folk in my class. ^_^

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

      @@azrafanwar5302 Awesome! I'm really happy you love it! And thank you for sharing :D

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

    Can you please link the video where you implement the CanMove and CanFlip functions

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

      Hey! I implement it in part 6B around 3:53

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

    Hey man. I know i´m a little late to the party but i have a problem. The Dash itself works perfectly but the afterImages are not spawing for some Reason i followed the Tutorial Step by Step (paused it a lot to understand) but obviously there is some fault i got in there... i tried to scale the Afterimages according to the player (My player is quite big) but that didn´t work for me aswell.

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

      Ah wait nevermind i found my error. Stil thanks a lot for the Tutorial really helped me to understand pooling

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

      Hey! I'm glad you found the issue! Also note that I made a small error and forgot to multiply the amount we are decreasing the alpha with by Time.deltaTime.

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

    Hey I love this video and hopefully you still respond to comments. I have succeeded in implementing the dash but for some reason the afterimage doesn't show up. The only difference is I put my sprite as a child gameobject to my player. I've tried changing the playerSR to PlayerSR = player.GetChild(0).GetComponent(); but its still doesnt work.

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

      This is a bit older, but my initial thought is that the sprite is being drawn, but because it is the child of the player when it sets the position, it’s behind your actual sprite. When not parented, it will stay in the world position, but under the player means it will move with the player.
      You could test this by having the dash sprite higher in the render order than the player sprite.

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

    I did everything in the video but my character just dash at the same place my player is standing. I can see the images running when I press left shift but it doesn't move =/

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

      Did you add the dash boolean to the if statements in ApplyMovement?

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

      @@Bardent Sorry but can you explain me how to do that? I can't find the part where you implemented this in ApplyMovement.

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

      @@Bardent I just went and triple checked and you never once mention adding anything to the IF statements in ApplyMovement...

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

      My bad it's been a while since I made this video. You don't need to add anything to the if statements there. Setting canMove to false takes care of that. Sorry @Prinny

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

    I get the error CS0201 on the PlayerAfterImagePool script, any idea how to remove this?

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

      Instead of instanceToAdd.transform.setParent(transform); try instanceToAdd.transform.parent = transform;

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

    Why do i get so many compiler errors from SerializedField and SpriteRenderer?

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

    The character goes through the wall when dashing.

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

      In Rigidbody2D change Collision Detection to Continuous

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

      @@MooNDesigns I have done that already but still it happens. Only happens when I use dash

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

    I press the Dash button and my sprite starts glitching between Idle and moving and then if I press Jump they go flying off in the direction they're facing.... It will also continue doing this until I hit a wall and the wall sliding resets something...

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

      I had Time.Deltatime instead of Time.time in the AfterImageSprite script. So now the after image effect works but it's permanent and doesn't stop until I hit a wall just like before, just now the glitching and the moving all have after images LMAO

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

      Missing a -(minus) for dashTimeLeft -= Time.deltaTime.... But all that did was make it so that now the after image effect goes away when time runs out lmfao.... all the problems are still there. glitching, flying off when jumping during the image effect.... This is ridiculous.. If you would slow the hell down and not edit through your mistakes we wouldn't have so many problems. You go way too quickly

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

      Basically it's only letting Dash work if I am not grounded or touching a wall but that restriction is not in the code anywhere.... This is so frustrating

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

      I got a couple of error too :(

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

      Okay so your dash on starts if you are grounded and not if you jump then try to dash? I'm not too sure what is happening on your end but if you want you can send me a clip of what is happening and your code on discord and I can take a look for you :)

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

    i love you MAN, Thank you !;

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

    What is canMove , canFlip and fancingDrection

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

    hey man great tutorials , btw there's a bug when standing next to a wall , you can infinitely jump

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

      Hey! Thank you :D try decreasing your ground check radius to be smaller than your collider so it does not detect the wall as ground :D

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

      @@Bardent will do thank you

  • @g.nath0
    @g.nath0 ปีที่แล้ว +1

    It's work for me Thank you so much! 😂😂😂😂

  • @9susen15
    @9susen15 5 ปีที่แล้ว

    Hey where you learned all of this things ? :) Where did you begin ?

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

      Hey! So I started some of the official unity tutorials on their site. It has changed a lot since I started though but I am sure it has only gotten better. Then after that I just try to make my own little thing and when I get stuck I look for tutorials online. There are some really good udemy courses that I took that have lots of sales so keep an eye on that. But yeah. I basically just followed as many tutorials as I can till I feel confident enough to make my own thing. Good luck!

    • @9susen15
      @9susen15 5 ปีที่แล้ว

      @@Bardent Nice thanks for answer btw amazing tut

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

      Thank you :D

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

    I got it to work without using canMove or canFlip, but the after image is huge lol

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

    it just didnot work, no error massage, not a single thing happened, the code is not working, i copy the code three times and it still not working and it's tilted as fuck

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

      Mine isn’t working either :/

    • @ΓιωργοςΠαναγιωτίδης-ω2μ
      @ΓιωργοςΠαναγιωτίδης-ω2μ 7 หลายเดือนก่อน

      i know that it is late, but the problem is that when you create a new input, you always need to check the type of it. You set the positive button to be left shift, but thee type should also be key or mouse button instead of joystick button

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

    Hi there awesome tuts dude..
    im trying to implement an animation for dash but can't figure it how
    to do it..can someone help me plzzzzzz^^

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

    Thanks amazing video 😍😍👍👍
    I really liked ur channel
    I hop u make a video for saving games data for the player like gem and guns and health

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

      Hey! I'm so happy you liked it! I'll definitely look into things like that eventually :D

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

    This is a good tutorial, but you need to cool Down.

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

      Very true

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

      @@Bardent you write so fast hahaha

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

      Yeah unfortunately I thought it would be nice to edit it like that. I was wrong XD don't worry it doesn't stay that way

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

      @@Bardent I have finished to whole course, and I have a bug, when I press “A or D” (so I would potentially walk straight forward), while ledge climbing my character can’t move, do you know about this problem or should I try to find a tutorial to fix this problem?

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

      Huh unfortunately I'm not too sure what you mean and I need to go somewhere now. Can you send me a message on discord describing what is happening and maybe include a video? I'll reply asap :)

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

    I've checked and rechecked my code and can't get my character to dash. I even copy-pasted the google drive code into Visual Studio and it still doesn't work. Not sure what the problem is.

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

      I know it maybe silly to ask but have you made sure that your player/ character is named and referenced the exact same in unity, and your players script class? If the spelling or capitalizations are different it won't recognize the game object that it's supposed to reference.

    • @ΓιωργοςΠαναγιωτίδης-ω2μ
      @ΓιωργοςΠαναγιωτίδης-ω2μ 7 หลายเดือนก่อน

      i know tha it is late, but the broblem is that when you create a new input, you always need to check the type of it. You set the positive button to be left shift, but thee type should also be key or mouse button instead of joystick button