Easy 2D Melee Combo System in Unity: Tutorial

  Рет қаралды 78,902

ChosenPlay

ChosenPlay

3 жыл бұрын

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 KZbin Channel: / @gamesbysaul
----------
CHOSENPLAY SOCIAL LINKS:
----------
Discord: / discord
Facebook: / chosenplaystudio
Twitter: / chosen_play
IF YOU WANT TO SUPPORT US:
Patreon: / chosenplay

Пікірлер: 232
@chosenplay6896
@chosenplay6896 3 жыл бұрын
UPGRADED VERSION OF THIS TUTORIAL TO BE FOUND IN HERE: kzbin.info/www/bejne/rqObhoOLlL1qd5o
@Charditronic
@Charditronic 3 жыл бұрын
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 жыл бұрын
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
@Krechevskoy
@Krechevskoy 3 жыл бұрын
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.
@memeaste7820
@memeaste7820 10 ай бұрын
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!
@Soundy777
@Soundy777 3 жыл бұрын
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 :)
@kevinjordan3449
@kevinjordan3449 Жыл бұрын
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!
@chunkytoads4509
@chunkytoads4509 3 жыл бұрын
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! :)
@GermanCoronel
@GermanCoronel 3 жыл бұрын
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 жыл бұрын
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 :)
@Moita77
@Moita77 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.
@chosenplay6896
@chosenplay6896 3 жыл бұрын
I'm glad you found it useful :)
@GamesBySaul
@GamesBySaul 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 жыл бұрын
No problem Dude. I hope it'll hep you and yeah, I'm really glad you helped out myself :)
@GamesBySaul
@GamesBySaul 3 жыл бұрын
@@chosenplay6896 :D
@jaypoppinFOOL
@jaypoppinFOOL 4 ай бұрын
Wow, after looking up so many videos this is by far the easiest method. Thanks so much!!
@gabrielvictor4460
@gabrielvictor4460 3 жыл бұрын
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 жыл бұрын
Really glad you found this useful :) Also.. did you check the new upograded version of this? Might make your life even easier :)
@ivypogee
@ivypogee 2 жыл бұрын
Thank you. Im new to programming(unity) and want to make 2d platformer, this helps alot.. defintely subscribing :) keep them coming!
@hyper190
@hyper190 3 жыл бұрын
This just makes it look easy! Thanks a lot!
@chosenplay6896
@chosenplay6896 3 жыл бұрын
You're welomce! Glad it helped :)
@Gutek8134
@Gutek8134 Жыл бұрын
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.
@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!
@DemsterDog
@DemsterDog 3 жыл бұрын
This Helped A Lot Buddy Thanks Alot.
@chosenplay6896
@chosenplay6896 3 жыл бұрын
you're welcome :)
@lutherevangelista605
@lutherevangelista605 3 жыл бұрын
so simple yet so so good thanks!
@chosenplay6896
@chosenplay6896 3 жыл бұрын
You're welcome. Glad you found that useful :)
@animemazegaming
@animemazegaming 2 жыл бұрын
Thank u u are a great man saved a lot of coding work
@NameUnknown-
@NameUnknown- 3 жыл бұрын
Looks nice and simple. Good solution. Btw, for your example you could have used the same trigger for every attack of the combo
@chosenplay6896
@chosenplay6896 3 жыл бұрын
You're actually right! Thanks :)
@jmiller6224
@jmiller6224 2 жыл бұрын
Legendary. Thank you, good sir
@barnesnplebian6462
@barnesnplebian6462 2 жыл бұрын
Can confirm. Went crazy trying to use timers.
@Ren-kei
@Ren-kei 3 жыл бұрын
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!
@mattjclay
@mattjclay 3 жыл бұрын
Damn. Didn't know i could add scripts to animations. Thanks for that my friend.
@chosenplay6896
@chosenplay6896 3 жыл бұрын
You're welcome :)
@scobro
@scobro Жыл бұрын
does this script spawn in the attack box that would allow the player to do damage to the enemies in a game?
@AlexBlackfrost
@AlexBlackfrost 3 жыл бұрын
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 жыл бұрын
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 Жыл бұрын
I found that problem too, and that's why I´m here... LOL
@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
@HenriqueAzevedoarts
@HenriqueAzevedoarts 3 жыл бұрын
congragulation for channel
@chosenplay6896
@chosenplay6896 3 жыл бұрын
Almost empty atm.. but thanks :)
@bonknya565
@bonknya565 3 жыл бұрын
nice tut :D, love u
@chosenplay6896
@chosenplay6896 3 жыл бұрын
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
@nightlaven
@nightlaven 3 жыл бұрын
Easy, very simple, and its working thanks
@chosenplay6896
@chosenplay6896 3 жыл бұрын
Glad to have been of help :)
@JuanFranco-mq7js
@JuanFranco-mq7js 3 жыл бұрын
I will try it, looks promising.
@chosenplay6896
@chosenplay6896 3 жыл бұрын
I'll soon be publishing an update to this :)
@miguelvelasquez6152
@miguelvelasquez6152 3 жыл бұрын
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 жыл бұрын
@@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.
@afridirahim4634
@afridirahim4634 3 жыл бұрын
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.
@juanandresherrera4633
@juanandresherrera4633 3 жыл бұрын
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 жыл бұрын
Perhaps this might help: kzbin.info/www/bejne/oZi9k56YgtCVf7s :)
@GermanCoronel
@GermanCoronel 3 жыл бұрын
@@chosenplay6896 This totaly helped me thankS!!!!!
@ilikespaghetti2170
@ilikespaghetti2170 3 жыл бұрын
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.
@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 жыл бұрын
Done: kzbin.info/www/bejne/oZi9k56YgtCVf7s :) I hope I managed to explain it well I did my best ^^
@nicholasboone4050
@nicholasboone4050 2 жыл бұрын
Where can i get that sprite
@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
@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 жыл бұрын
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.
@erosjagatpulagana6403
@erosjagatpulagana6403 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@chosenplay6896 Nah, i got it. Thanks for the explanation ;)
@ammarul7978
@ammarul7978 8 ай бұрын
It's also work on 3d too right?
@Movehawkzz
@Movehawkzz 26 күн бұрын
Can you do the same Tutorial on Jumping attacks with combo?
@peanut5435
@peanut5435 3 жыл бұрын
Thhanks mate :D
@chosenplay6896
@chosenplay6896 3 жыл бұрын
You're welcome :)
@jorgeponce5147
@jorgeponce5147 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@chosenplay6896 Thank you very much for your work! I wait for the video. I am a new subscriber.
@chosenplay6896
@chosenplay6896 3 жыл бұрын
@@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...
@Hotaiji
@Hotaiji 10 ай бұрын
why do you even call the input manager function after you write instance.inputReceived=false; ?
@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 :)
@joelbarish8257
@joelbarish8257 3 жыл бұрын
Thank you man great video but can you make another video about parry system please
@chosenplay6896
@chosenplay6896 3 жыл бұрын
I'll add that to the "to do" list :)
@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 жыл бұрын
@@chosenplay6896 No i meant "transition1" and "transition2"
@dennisdanso4160
@dennisdanso4160 3 жыл бұрын
got it! Thank you so very much i really appreciate it
@chosenplay6896
@chosenplay6896 3 жыл бұрын
@@dennisdanso4160 Ah ok, I got what you meant I think. Yeah, they have animations in. The transitioning animation from attack to idle.
@perssontm1628
@perssontm1628 3 жыл бұрын
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 жыл бұрын
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 2 жыл бұрын
did you solve it? I get the same error
@gummyblade
@gummyblade Жыл бұрын
@@carmen-andreeabajanaru3319 same error
@gummyblade
@gummyblade Жыл бұрын
@@perssontm1628 same error
@BluePhantomGames
@BluePhantomGames 3 жыл бұрын
My game is gonna be great for sure
@chosenplay6896
@chosenplay6896 3 жыл бұрын
I hope it will! Let us know :D
@axmaxstudio7082
@axmaxstudio7082 3 жыл бұрын
Ottimo video ;)
@chosenplay6896
@chosenplay6896 3 жыл бұрын
Grazie :)
@devy1451
@devy1451 4 ай бұрын
Whats is the name of the first game ?
@smabuzzaka1031
@smabuzzaka1031 3 жыл бұрын
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 :)
@rdxgamingrg2130
@rdxgamingrg2130 3 жыл бұрын
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.
@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 жыл бұрын
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 :(
@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.
@joserogeldev
@joserogeldev 3 жыл бұрын
thanks!
@chosenplay6896
@chosenplay6896 3 жыл бұрын
You're welcome :)
@jash5596
@jash5596 11 ай бұрын
you are the best❤🎉
@nicholasboone4050
@nicholasboone4050 2 жыл бұрын
will that work on a startrun run and stoprun?
@nicholasboone4050
@nicholasboone4050 2 жыл бұрын
if to use what i just watch?
@guilhermelopesboroni6038
@guilhermelopesboroni6038 3 жыл бұрын
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
@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
@capeto.
@capeto. 8 ай бұрын
Se puede para 3d??
@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?
@TheDoomLordd
@TheDoomLordd 3 жыл бұрын
Really good tutorial, tho idk if its just my Audio setup but it was really quiet
@chosenplay6896
@chosenplay6896 3 жыл бұрын
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 :)
@marcodiazordonez115
@marcodiazordonez115 3 жыл бұрын
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
@hollowsoul5499
@hollowsoul5499 3 жыл бұрын
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 жыл бұрын
@@chosenplay6896 thank you for replying fast i found that i messed up body rotations thanks
@argisnutz
@argisnutz 3 жыл бұрын
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.
@duelsoldier3048
@duelsoldier3048 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
@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 ^^''
@kserra9112
@kserra9112 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
@SAHILPathan-bp5sv
@SAHILPathan-bp5sv 3 жыл бұрын
Nice BRO
@chosenplay6896
@chosenplay6896 3 жыл бұрын
thanks :)
@cratuss2661
@cratuss2661 3 жыл бұрын
where are you calling the Attack Method? i dont get it :(
@chosenplay6896
@chosenplay6896 3 жыл бұрын
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 :)
@salahounissi1794
@salahounissi1794 3 жыл бұрын
please do tutorial on how to catch androp enemy during melee combat u got my big support
@chosenplay6896
@chosenplay6896 3 жыл бұрын
Yo, what do you mean? Like a grabbing attack were the player literally grab the enemy and throw it away?
@salahounissi1794
@salahounissi1794 3 жыл бұрын
@@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 :)
@jonathanmora8208
@jonathanmora8208 3 жыл бұрын
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 жыл бұрын
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
@lordcatington8188
@lordcatington8188 3 жыл бұрын
InputAction could not be found, what should I do?
@Assistiai
@Assistiai 3 жыл бұрын
Same here...
@MesaTheAalfa
@MesaTheAalfa 3 жыл бұрын
@@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 :) kzbin.info/www/bejne/oZi9k56YgtCVf7s
@Salmonwithfeet
@Salmonwithfeet 3 жыл бұрын
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 :)
@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 :)
@JKMT
@JKMT 3 жыл бұрын
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 жыл бұрын
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
@augustosimoes3806
@augustosimoes3806 3 жыл бұрын
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
@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
@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 ^^
@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 :)
@MertAliBarlas
@MertAliBarlas 3 жыл бұрын
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 жыл бұрын
@@chosenplay6896 hmm thats a better idea :) I'll send you via email
@MertAliBarlas
@MertAliBarlas 3 жыл бұрын
@@chosenplay6896 btw what is your gmail :S
@chosenplay6896
@chosenplay6896 3 жыл бұрын
@@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 жыл бұрын
@@chosenplay6896 Hello again :D I solved Luca. I was an idiot :/
@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 :)
@swanne22
@swanne22 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 жыл бұрын
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 :)
@marvinbarboza1045
@marvinbarboza1045 8 ай бұрын
are you using new input system or old? because its not fvcking working
@roshipanda27
@roshipanda27 3 жыл бұрын
There is an error in combat manager (4,30)
@chosenplay6896
@chosenplay6896 3 жыл бұрын
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 :)
@MesaTheAalfa
@MesaTheAalfa 3 жыл бұрын
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!!
@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 жыл бұрын
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 жыл бұрын
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)
@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 :(
@restushlogic5794
@restushlogic5794 3 жыл бұрын
Thank you. I hope you get rich.
@chosenplay6896
@chosenplay6896 3 жыл бұрын
Giving my family a decent life would be enough. But thanks :D
@THEPERFECTDUDE
@THEPERFECTDUDE 3 жыл бұрын
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
@ishaksmajic1497
@ishaksmajic1497 2 жыл бұрын
Don't do drugs kids.
@tgwrsdegtw
@tgwrsdegtw 2 жыл бұрын
Im from roblox i only know lua xd
@Ratos-
@Ratos- Жыл бұрын
this is such a bad toturial, constantly sped up and I'm getting errors for no reason
Easy 2D Combo System in Unity 2.0: Upgraded Tutorial
29:24
ChosenPlay
Рет қаралды 26 М.
2D Melee Combat Unity Tutorial
15:35
MoreBBlakeyyy
Рет қаралды 17 М.
Ну Лилит))) прода в онк: завидные котики
00:51
Indian sharing by Secret Vlog #shorts
00:13
Secret Vlog
Рет қаралды 51 МЛН
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 26 МЛН
1 класс vs 11 класс (неаккуратность)
01:00
БЕРТ
Рет қаралды 4,4 МЛН
Improve your Platformer’s Jump (and Wall Jump) | Unity
8:12
How to Make a 2D Melee Attack | EASY Unity Tutorial
20:38
Sasquatch B Studios
Рет қаралды 10 М.
How To Melee Attack From Hollow Knight
36:18
I_Am_Err00r
Рет қаралды 19 М.
How to create knockback in Unity
11:54
Sunny Valley Studio
Рет қаралды 30 М.
Melee Combat System in Unity 2D (With Targeting!)
20:35
Code Monkey
Рет қаралды 59 М.
Unity - 2D Melee Combo System Tutorial
22:15
Sean Masai Hill
Рет қаралды 68 М.
How to create a Fighting Combos System?
8:29
Fadrik
Рет қаралды 18 М.
Easy Unity Input System: Tutorial
18:41
ChosenPlay
Рет қаралды 1,8 М.
Simple Turn-Based RPG Battle System (Unity Tutorial)
35:22
Code Monkey
Рет қаралды 189 М.
3.5.A Solar Mobile 📱 Charger
0:39
Gaming zone
Рет қаралды 319 М.
iphone fold ? #spongebob #spongebobsquarepants
0:15
Si pamer 😏
Рет қаралды 129 М.
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 2,5 МЛН
Huawei который почти как iPhone
0:53
Romancev768
Рет қаралды 479 М.