Easy 2D Melee Combo System in Unity: Tutorial

Поделиться
HTML-код
  • Опубликовано: 10 июл 2020
  • Ever wanted an Easy solution at coding a 2D Melee Combo System inside the Unity Game Engine?
    Correctly coding it can be frustrating: the majority of solutions you'll think of or find on the internet will be either overly complicated or not even work.
    No worries! WIth this tutorial you'll be able to code your own 2d melee combo system in unity with:
    - No Timers needed
    - No Coroutines needed
    - Just few lines of code
    SPECIAL THANKS TO "GAMES BY SAUL" for helping me think about the logic of combo systems :)
    Games by Saul RUclips Channel: / @gamesbysaul
    ----------
    CHOSENPLAY SOCIAL LINKS:
    ----------
    Discord: / discord
    Facebook: / chosenplaystudio
    Twitter: / chosen_play
    IF YOU WANT TO SUPPORT US:
    Patreon: / chosenplay
  • НаукаНаука

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

  • @chosenplay6896
    @chosenplay6896  3 года назад +6

    UPGRADED VERSION OF THIS TUTORIAL TO BE FOUND IN HERE: ruclips.net/video/xr8UPU_X7A8/видео.html

  • @Charditronic
    @Charditronic 3 года назад +53

    I just wanted to thank you for this video! I'm not done to applying it in my project yet, but it's working! I was going crazy to make a damn chain of punches!
    Very efficient, thanks! ^^

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

      I'm very glad you found this useful! I hope I'll be able to make other valuable content in the future :)

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

      Chardi gracias por el link al tuto me a ayudado :D

  • @Soundy777
    @Soundy777 3 года назад +7

    Informative & Concise! Keep em’ coming buddy!

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

      Thank you, really glad you enjoyed it! Yeah I'll do more as soon as I have something to talk about that I think might be of use :)

  • @memeaste7820
    @memeaste7820 11 месяцев назад

    I was watching your first video on this, and saw the second part in the comment section. This was far easier, and it makes total sense. I didn't even know I could attach scripts to animation states. Thank you so much!

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

    This was an absolute diamond in the rough. It seems obvious now that you have explained it, but there aren't many other videos that discuss handling transitions, certainly not this well. Thank you!

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

      I'm glad it was of help! ;) Soon I'll be posting an upgraded version of this were I'll show all the process of coding it from scratch. It'll be improved of course. Probably 2-3 videos from now :)

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

      @@chosenplay6896 That's awesome! Keep up the great work.

  • @kevinjordan3449
    @kevinjordan3449 Год назад +1

    This was simple, straightforward and dope! I used this as the basis for the combo system in my game. In less than 15 minutes you solved a problem I spent years working on! Dope bro, Dope!

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

    Man, thank you very much! i had a little problems recreating this with my project but with the help of your answers in the comments and the Input video you made it worked just find!!! In some point i would love to make a version of this tutorial in spanish to share your method :D

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

      I'm glad this helped you! :)
      Also be sure to check the channel out cause some time ago I published an upgraded and WAY SIMPLER version of this combo system that you might find even more appealing :)

  • @jaypoppinFOOL
    @jaypoppinFOOL 5 месяцев назад

    Wow, after looking up so many videos this is by far the easiest method. Thanks so much!!

  • @Moita77
    @Moita77 3 года назад +3

    Just amazing, since last year this kind of combo programming is making easy our developer life in game. But is not all programmers that know how to explaing it to us, so, you did an amazing work here and I just want to Thank you for this. Thank you so much.

  • @chunkytoads4509
    @chunkytoads4509 3 года назад +10

    Clean, Easy, and Eloquent. Best setup and tutorial for combo attacks out there! Thank you for sharing the knowledge. You've got a subscriber here! :)

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

      I'm glad this was of some help to you! :)

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

    I was trying a kinda similar logic but would never get the coding done so easily if it wasn't for you, mister. Thank you!

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

      Really glad you found this useful :) Also.. did you check the new upograded version of this? Might make your life even easier :)

  • @GamesBySaul
    @GamesBySaul 3 года назад +3

    Sorry for not checking this out sooner! I'm glad I was able to help (somehow) - next time I need to do 2D combat I'll definitely be using this ;D

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

      No problem Dude. I hope it'll hep you and yeah, I'm really glad you helped out myself :)

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

      @@chosenplay6896 :D

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

    Thank you. Im new to programming(unity) and want to make 2d platformer, this helps alot.. defintely subscribing :) keep them coming!

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

    This just makes it look easy! Thanks a lot!

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

    dude, you are a fucking beast.
    I'm currently taking a IT course on game design but I really want to integrate my animation skills into it so I'm pouring a lot of effort on combo systems more than most students. This attack->transition-attack system is genius!
    Thank you and love from the Philippines!

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

    Can confirm. Went crazy trying to use timers.

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

    so simple yet so so good thanks!

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

      You're welcome. Glad you found that useful :)

  • @mattjclay
    @mattjclay 3 года назад +12

    Damn. Didn't know i could add scripts to animations. Thanks for that my friend.

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

    Legendary. Thank you, good sir

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

    This Helped A Lot Buddy Thanks Alot.

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

    I've had a problem programming combo system today. While I won't use the animation scripts system you do (I'll stick to that good old Coroutines in transition states), thank you for the general idea.

  • @NameUnknown-
    @NameUnknown- 3 года назад +3

    Looks nice and simple. Good solution.
    Btw, for your example you could have used the same trigger for every attack of the combo

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

    Thank u u are a great man saved a lot of coding work

  • @Ren-kei
    @Ren-kei 3 года назад +1

    Thank you for having an new input lesson this simple, im working on my first microgame and ive been trying to figure this out for a really long time the new system is very convoluted but flexible, and i am a low level kind of person so all these abstractions confuse the shit outta me.

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

      as soon as I've done with assets creation I'll pubolish a full little serie that'll also contain an upgrade to this :)

    • @Ren-kei
      @Ren-kei 3 года назад

      @@chosenplay6896 nice! thanks look forward to checking it out and trying it out of course!

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

    Easy, very simple, and its working thanks

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

    nice tut :D, love u

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

      Thanks. There will also be an upgrade to this system as soon as I finish working on assets and start the serie I'm working on :)

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

    Wow great video

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

    congragulation for channel

  • @JuanFranco-mq7js
    @JuanFranco-mq7js 3 года назад +1

    I will try it, looks promising.

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

      I'll soon be publishing an update to this :)

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

    Interesting implementation, great video! Did you consider using animation events to set time windows where you can receive combo inputs? If so, did you find any downside?

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

      I tried to do that before coming up with this method. I found it to be overly complex and convoluted and also not working a lot of times. Mainly due to animation freezing up and game breaking (mainly due to button mashing).

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

      @@chosenplay6896 That's some valuable information. Thanks for your fast answer!

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

      I found that problem too, and that's why I´m here... LOL

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

    Hey There! A Superb Tutorial Thanks very much. Just a question, Does the Attack() Function supposed to be called anywhere?

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

      That depends... Usually not, only as an event when the player press a button.. but it could also bne useful to be able and call it from elsewhere during cutscenes.

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

    please do the new input system tutorial you talked about in the video man... It's so hard to keep seeing bad tutorials online and every time they're different... That's a weird topic that I've seen nobody explaining right... Thanks for this tutorial though, it really helped me refine my project :)

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

      Done: ruclips.net/video/kgZbkbMkbIY/видео.html :) I hope I managed to explain it well I did my best ^^

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

    My game is gonna be great for sure

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

    Thhanks mate :D

  • @jash5596
    @jash5596 11 месяцев назад

    you are the best❤🎉

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

    Ottimo video ;)

  • @JOHNSMITH-sj3lg
    @JOHNSMITH-sj3lg 2 года назад

    is it realy only for 2D or can i use it in a 3D game also? and thanks for the sharing of ur great work my friend :)

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

    Thank you for this video! Great explanation! This might be a dumb question but... what about is you want the player to walk-run? Do I replace Idle for Walk-Run state?

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

      What do you mean "walk-run"? From attack directly to run? from walk to run? :)

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

      @@chosenplay6896 I meant when you are walking or running then you want to melee attack.

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

      @@miguelvelasquez6152 Yeah it's just the same.. you just got to connect the animation to the walkor the run one.. but that will not even be necessary when I?ll do the upgrade on the combo system in the future :)

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

      @@chosenplay6896 Alright, thnk you sir. Ill be up for next videos.

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

    so in short, what we have to do is that we just have to let the attack animation end after each button input, therefore no timing would be required. and if we press the input again mid animation, the attack will chain. did i get that right? im new and still trying to learn

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

    Thank you man great video but can you make another video about parry system please

  • @Movehawkzz
    @Movehawkzz Месяц назад

    Can you do the same Tutorial on Jumping attacks with combo?

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

    thanks!

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

    That's actually quite interesting approach. But is there a downside that we should aware of when apply the combo without the timer rather than using timer ?

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

      If I understand your point correctly you'd like to know when to use this method or when to use a timer for a combo. I'd say the answer is, as it is for a lot of different things related to coding: "it depends on your needs".
      For basic combo attacks I see absolutly no need to use timers most of the times BUT perhaps you want to have a "delayed" attack that can only be done if the button is pressed some seconds after the first attack.. in that case you would probably want to use a timer.
      Did this help? If I didn't understand you point correctly please feel free to explain it better :)

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

      @@chosenplay6896 Nah, i got it. Thanks for the explanation ;)

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

    does this script spawn in the attack box that would allow the player to do damage to the enemies in a game?

  • @SAHILPathan-bp5sv
    @SAHILPathan-bp5sv 3 года назад +1

    Nice BRO

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

    Really good tutorial, tho idk if its just my Audio setup but it was really quiet

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

      Might very well be my setup.. I'll try to make it better for the next videos as soon as all the materials I'm preparing for them are ready :)

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

    Transition!! Is the transition is emty ? Or idle state

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

      In the soon to be released new tutorial with the upgraded version of this I'll try and show every single passage :)

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

    Could you show how we should write the Attack function if we want to use to old input system? It's not quite working for me

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

      Perhaps this might help: ruclips.net/video/kgZbkbMkbIY/видео.html :)

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

      @@chosenplay6896 This totaly helped me thankS!!!!!

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

    hello im a beginner game dev
    how do I deal with different animation sizes, the idle size works fine but when it comes to attack it doesn't look right, my character just blinks and do the attack animation because of the size.
    any help would be appreciated thanks

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

      in the new tutorial I'm working on (upgraded combo system) I'll try and show how to correclty import an animation.

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

    now the attack doesn't work at all, there are no errors or warnings and i did everything exactly like you, any idea why this is?
    EDIT: also what i want is the first attack only being played once and the second and third attack repeating instead of all 3

  • @ammarul7978
    @ammarul7978 9 месяцев назад

    It's also work on 3d too right?

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

    Where can i get that sprite

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

    hello, does those the transition animation state contain any animations?

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

      If you're talking about the finite state machine they are contained inside animation states in Unity animator.

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

      @@chosenplay6896 No i meant "transition1" and "transition2"

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

      got it! Thank you so very much i really appreciate it

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

      @@dennisdanso4160 Ah ok, I got what you meant I think. Yeah, they have animations in. The transitioning animation from attack to idle.

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

    please do tutorial on how to catch androp enemy during melee combat u got my big support

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

      Yo, what do you mean? Like a grabbing attack were the player literally grab the enemy and throw it away?

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

      @@chosenplay6896 yes exactly

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

      @@salahounissi1794 I'll see what I can come up with when I get some free time :)

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

      @@salahounissi1794 Yo, would you mind contacting me on our discord channel? (you can find the link in the video description) I'd like to get a better understanding on your needs for this tutorial you asked for so I can be sure to get the right points in :)

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

    hello friend, I'm trying to make a sword comb for my 2D character, but I'm still drawing the animation, you know where I find a good reference, because my game is vector

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

      Other games.. play a lot, watch a lot, watch gameplay.. if you can screen record the games as you play them, cut the videos so you only see the animation you want and turn them to gif.. then you can see it frame by frame in many programs.

  • @SAHILPathan-bp5sv
    @SAHILPathan-bp5sv 3 года назад

    please make a full game
    Your tutorial is very easy

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

      I'm currently working on assets for a full tutorial serie on basic game creation :)

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

    thank you can you make a video on how to cut the animation so it doesnt look wonky

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

      I don't really get what you mean with this.. could you elaborate a little bit? Your animations "shakes?" when inside unity? Are they fine when you're drawing them in the art program?

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

      @@chosenplay6896 thank you for replying fast i found that i messed up body rotations thanks

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

    I would like to make my character transform into different shapes before jumping or running is there a way to make this possible

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

      Well... if you're talking animatino wise you need to create the transform animation and then fire it before everything inside the game editor.. but from the question I guess you don't really know how Unity works as a game engine.. so may I suggest you take a course or something to learn how unity works first of all? :) I do not have such a course sadly.. but I can give suggestions about good ones if you want.

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

    During transition one, when I press the button it doesn't lead me to attack two, I don't know why... Maybe the transition one and two are empty , I wonder if it has to have an animation

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

      I'm starting like.. right now to work on the tutorial for the upgraded version of the combo system.. I hope to publish it soon :) This time I'll show every single passage on screen to avoid such problems.

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

      @@chosenplay6896
      Thank you very much for your work! I wait for the video. I am a new subscriber.

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

      @@jorgeponce5147 You're welcome! I hope the channel's even tho small will be of use to you :)
      P.S. was just making trials for the new system.. it's so easy to set up it's scary... if everything goes well it'll be on the channel by tomorrow evening or the day after I hope :)

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

      @@chosenplay6896 Espectacular! esperando para verlo! Gracias...

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

    So the attack transition is basically just a few frames from the end of the attack animation

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

      Yes. Usually it's the motion that brings the character from the end of the attack back to Idle. LIke, just to make an example,, sheating the sword, or lowering the fighting stance.

  • @Hotaiji
    @Hotaiji 11 месяцев назад

    why do you even call the input manager function after you write instance.inputReceived=false; ?

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

    will that work on a startrun run and stoprun?

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

    What is inside the transition animation

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

      If you search the channel you'll find an upgraded version of this tutorial (should also be the link in the pinned comment of this video you've commented under) and in that video you'll see everything.. ofc also the transition animation.

  • @swanne22
    @swanne22 3 года назад +3

    Hi. Can you please show us each of your animations individually? You say that you have already created all animations but it will really help if I was able to each of them including the transitions then I could see how they all piece together

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

      It's just as I said at the beginning of the video: an animation is made up of many frames. There are the ones that are "charging" the attack that are usually called "anticipation frames" then there is the attack itself and after that there are some frames were the character usually brings the weapon back to idle position.
      Those last frames are the onest to use :)

  • @devy1451
    @devy1451 5 месяцев назад

    Whats is the name of the first game ?

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

    I get spammed with this error, think you can help me?
    NullReferenceException: Object reference not set to an instance of an object
    IdleBehavior.OnStateUpdate (UnityEngine.Animator animator, UnityEngine.AnimatorStateInfo stateInfo, System.Int32 layerIndex) (at Assets/IdleBehavior.cs:16)

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

      I definitly can't without access to your code. But that said.. at the moment I'm not recording videos because I have a very important freelancing job that I need to finish and I do not ahve the time for tutorials.. but as soon as I'll be free the next video on the channel is going to be an upgraded version of this combo system. I'll also record it "from start to finish" with no cutting or particular editings so that such errors will be very hard to get :)

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

      @@chosenplay6896 Maybe you could upload your project if you have it left and i can see my self what i did wrong

    • @carmen-andreeabajanaru3319
      @carmen-andreeabajanaru3319 3 года назад

      did you solve it? I get the same error

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

      @@carmen-andreeabajanaru3319 same error

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

      @@perssontm1628 same error

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

    Does this method work for a 3D game or am gonna have to make adjustments

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

      Not 100% sure cause I do not do 3d.. but since it's just a matter of linking animations I do not see why it shouldn't work ^^''

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

    Good night, would it be possible to make the code available? I'm starting at Unity and I couldn't make it work like yours. I would like to analyze your example. thanks

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

      I don't even have that code anymore but perhaps I might consider sharing the new one for the upgraded version that'll be released as soon as I can.. I'll consider it.

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

      @@chosenplay6896 Cool, I would appreciate it very much.

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

      @@guilhermelopesboroni6038 You can already find the upgraded version of the combo system on the channel.. it was published yesterday.
      I decided not to put the code on but mainly because it's just so easy and with so few lines I considered it to be useless.. well you will see as soon as you check the video out :)
      In the new version tho I showed everything with almost no cuts so it should be easy to set everything up :)

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

      @@chosenplay6896 cool, thank you very much

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

    holy crap, i already have shit tons of click ++ in my code. Any chance you can teach us how to make a simple combo system as well like up up down then use this skill (like street fighter)

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

      Well.. at the moment I'm working on creating assets (most of them will be free on itch) for a complete tutorial/course serie on game dev in unity... I don't think this specific request'll be part of it BUT I think that would not be that hard to implement.. It's probably just a matter of creating custom input pattern (expecially in Unity new Input system it can be done quite easely) and then adding transitions :)

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

      @@chosenplay6896 id love to see a tutorial on the new input system

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

    please.. what is the name of the video games at the beginning, thanks for all

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

      One is Dead Cells and the other is Guacameleeee

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

    Tried it, doesn't look like it worked, can you recommend any videos or tutorials that might help with the button mashing problem?

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

      Nope sorry.. I came up with this kinda on my own I've never seen a video for it myself...

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

      @@chosenplay6896 I get ya. thanks all the same, and good video

  • @duelsoldier3048
    @duelsoldier3048 3 года назад +3

    Good tutorial but when i click nothing happens (by the way i am using old input Input.GetButtonDown("Fire1")) there is no spelling mistakes

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

      If you want you can send me an unity package and I'll check it out when I can. The only other time this happened tho it was because they forgot to activate the "canreceiveinput" bool before trying it out :)

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

      this is happening to me too, i activate the bool and if i press the fire key very very fast it works, or changing buttonDown to GetButton, but this is not correct becouse you can hold the button for ever and keep attacking, do you find any solution? thanks

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

    Yes do the new input system tutorial please... :

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

      I'm currently working on assets for a complete "let's create" serie of videos that'll also have the new Input system :)

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

      @@chosenplay6896 Can't wait!!

  • @capeto.
    @capeto. 9 месяцев назад

    Se puede para 3d??

  • @kserra9112
    @kserra9112 3 года назад +3

    Don't you need to set the canReceiveInput to true from the IdleBehavior script?
    //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    //{
    // cm.canReceiveInput = true;
    //}
    At least, my implementation doesn't work unless I do that.
    Since canReceiveInput is never initialized as true, you cannot check inputReceived, and the whole process never starts.

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

      Yeah this was my first tutorial, I wasn't confident enough with my english and as such I recorded the audio and the video separatedly.. that made for all sort of issues when I did put it togheter and some things were mistakenly left out.
      As you'll see tho I've changed way of doing these tutorials and I know do them directly from scratch showing every single step of the process. Soon enough (probably 3 videos from now) there'll be an upgraded version of the combho system tutorial that'll be published and every single step will be shown :)

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

      THANKS! This totaly worked for me! :D

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

    where are you calling the Attack Method? i dont get it :(

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

      I do not "call it" because it's an event that works with the new input system. BUT if you want to use it with the old input system you just call it in the update :)

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

      @@chosenplay6896 ahh now i understand. But i have 1 question: what exactly are you doing In Transition 1 2 and 3? are they only playing the same end-animation as AttackOne AttackTwo and AttackThree? or are they playing nothing? im really confused how the "inside" of these 3 Animations look in the "Animation"-Component (Not Animator)

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

      nevermind i found out by myself im stupid :D

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

      @@cratuss2661 Naaa you are not... after all you found it out by yourself didn't you? :D And even if you didn't.. it would probably be more a matter of me not managing to explain it well then you beeing tupid :)

  • @th.ratzicha
    @th.ratzicha 3 года назад

    Do you need to attach any of the scripts to the player?

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

      If you do it the same way I did... everything but the finitestate scripts are on the player. But of course you can also put them on a random object, create a reference to the player and use it that way... you can always do stuff inmany different ways while coding :)

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

    doesnt work? the behavior scripts dont recognise inputRecieved. CS1061
    edit: spelling error
    still deosnt work though

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

      I'm starting right now to work on the upgraded version of this.. Will show every single passage on screen this time and hopefully it will solve problems some people are having :)

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

    It won't work when I'm clicking, but it will play the first attack animation as soon as I play the scene. help

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

      First of all... Relax :D Second: hit me up on discord and I'll see what I can do to help.
      As a third: as soon as I have some free time there'll be a new tutorial with the new improved version of this coming up.. only this time I'll show every single step with almost no editing so that errors such as these will be hard to come upon :)

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

      @@chosenplay6896 yes man lol, i am relax tho :(

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

    Hello mate,
    in my character, I'm using rig animations and there is some bugs. I will send you a video on discord server can you have a look ?

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

      You can send it to me on discord in a private chat if you want and I'll definitly take a look at it. You should know tho that I've never used tig animations up until now.. always go with frame by frame art.. so don't be mad if I can't help.
      Also... if you want you can also send a project package via mail no p0roblem so I can look at it directly inside unity and report back :)

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

      @@chosenplay6896 hmm thats a better idea :)
      I'll send you via email

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

      @@chosenplay6896 btw what is your gmail :S

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

      @@MertAliBarlas Know what? You're right: I can be an idiot at times :P it's "chosenplaystudio@gmail.com". I'll look at it as soon as I can :)

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

      @@chosenplay6896 Hello again :D
      I solved Luca. I was an idiot :/

  • @ty-xq7bl
    @ty-xq7bl 3 года назад

    how well does this work with 3d?

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

      No idea, I don't do 3d :( You can try and let everyone know ^^

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

    I did the tutorial, it didn't give any error, but it doesn't call the attack animations.

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

      Did you set the "canreceiveinput" boolean to true?

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

      @@chosenplay6896 On inspector yes, now if i click on trigger in animator call the animation, but not when i click the button if i set on code not happens

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

    Hi can you help me? It doesn't work on me? everytime i press I nothing happens? i follow all the codes exactly and the animator diagram and exit time all but nothing happens?
    im wondering when will be my pressed key (I) activated on the idlebehaviour? In the combat manager the attack method is not on update like in the video?
    public class CombatManager : MonoBehaviour
    {
    public static CombatManager instance;
    public bool canRecieveInput;
    public bool inputRecieved;
    void Awake()
    {
    instance = this;
    }
    // Start is called before the first frame update
    void Start()
    {

    }
    // Update is called once per frame
    void Update()
    {

    }
    public void Attack()
    {
    if (Input.GetKeyDown(KeyCode.I))
    {
    if (canRecieveInput)
    {
    inputRecieved = true;
    canRecieveInput = false;
    }
    else
    {
    return;
    }
    }
    }
    public void InputManager()
    {
    if (!canRecieveInput)
    {
    canRecieveInput = true;
    }
    else
    {
    canRecieveInput = false;
    }
    }
    }
    ---------------idlebehaviour-----------
    override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
    if (CombatManager.instance.inputRecieved)
    {
    Debug.Log("test");
    animator.SetTrigger("AttackOne");
    CombatManager.instance.InputManager();
    CombatManager.instance.inputRecieved = false;
    }
    }
    i tried to debug it but it doesn't show on the log? Can you help me?

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

      Hello there! I'm sorry you're having trouble. The thing is.. it's kind of hard to tell why it's not working just from these small lines of code... I'll read this again in a little while to see if there're typos (I just woke up.. not really "lucid" enough for this xD ) but if you want, if your game is still in the prototyping stage and not that "built up" you can send me an email at "chosenplaystudio@gmail.com" with a unity package so I can open it up in unity and see if there's something I can help you with... no guarantees tho :)

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

      when i understand it right his method wont work without the new Input System. the Method Attack() is never called or is it?

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

    InputAction could not be found, what should I do?

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

      Same here...

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

      @@Assistiai make sure to use unity library by writing ( using UnityEngine.InputSystem ) like in his video

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

      Same here..

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

      I solved :) Go window -> package manager -> install inputsystem thx lot

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

      That's because I was using the INput system. Tutorial on that just published :) ruclips.net/video/kgZbkbMkbIY/видео.html

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

    I managed to make it work with old input system but most times it stop working during animation Attack three (Can Recieve Input bool untick and stay that way) I will continue working on it or maybe you guys will not have the same problem but if you guys have it and know how to fix it please help me :D
    void Update()
    {
    if (Input.GetKeyDown("x"))
    {
    Attack();
    }
    }
    public void Attack()
    {
    if (canRecieveInput)
    {
    inputRecieved = true;
    canRecieveInput = false;
    }
    else
    {
    return;
    }
    }

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

      I'ìm also working on perfecting in for the tutorial serie that'll come out as soon as I have all assets ready :)

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

      @@chosenplay6896 Great thank you , I made it work with no problems and implemented damage and also works great with touch controls

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

      @@jonathanmora8208 How did you fix the canReceiveInput thing where it stays false after attack 3? I have the same problem

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

      @@christhedevYTsry for late reply , after if(!canRecieveInput)
      {
      canRecieveInput = true;
      }
      Here there is an else I deleted it and now my code works without problem

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

    The combo works but after a few punches the canReceiveInput bool is permanently set to false and because of that nothing happens afterwards

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

      Definitly something wrong in your implementation.. sadly not having the project myself I can't tell what exactly :(

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

      Same here can you solved ?

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

      I solved write your button code
      canreceiveinput = true;

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

      For me it was a diffefent error

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

      I removed the else return 0 and it worked

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

    It dont lets me write using unity engine. InputSystem

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

      Sorry for the late reply. Made an improved version of this that might help you out.. also you can check out the tutorials I made about the unity input system and those might help you get a better understanding on how to set the inputsystem up :)

  • @marvinbarboza1045
    @marvinbarboza1045 8 месяцев назад

    are you using new input system or old?
    because its not fvcking working

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

    thanks for the video, it's amazingly easy. new subscriber
    I only have one problem, when the player presses the attack button many times in a row, it performs 1-2 more attacks (input lag). If someone can solve it, it would help me a lot to know how I do it, thanks in advance.
    sorry for the terrible English, I speak Spanish.

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

      An upgraded tutorial on this will soon be released. I've just finished a job and now I'll be starting to work on it :)

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

      @@chosenplay6896 thank you very much, your videos have helped me a lot

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

      In case it works for someone, I managed to solve the input lag by adding a script to the last attack of the combo, and placing an almost imperceptible combo cooldown for the player (0.4)

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

    Thank you. I hope you get rich.

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

      Giving my family a decent life would be enough. But thanks :D

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

    There is an error in combat manager (4,30)

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

      I've just finished a little job I was given. This means that the next days I'll be working on an upgraded version of this tutorial. Soon to be published :)

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

    make this for enemy

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

      It literally chance nothing if not that instead of the Input starting the action you start it with some kind of logic.. like calculating the distance from the player and if distance

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

    When Finish the tutorial test the game it wasn’t working

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

      Definitly something wrong with your implementation.. sadly I can't say more than that tho not having the projhect in front of me :(

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

    Don't do drugs kids.

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

    Im from roblox i only know lua xd

  • @Ratos-
    @Ratos- 2 года назад

    this is such a bad toturial, constantly sped up and I'm getting errors for no reason