Melee Combat & Weapon System - Unity Beginner Tutorial

Ойын-сауық

Use Code: ZYGERNY22 for an extra 10% off at checkout
prf.hn/l/K9D1xV8
Assets Used In The Video:
on.unity.com/3EP48uY
on.unity.com/3oHeUh5
In this beginner easy tutorial I will show you how to make a melee system for your game. This tutorial will cover how to create the mechanics of the weapon, animations and how to make it work in actual combat. I will go over how to deal damage with the weapon to enemies and how to set those enemies up. This is a more in depth tutorial as I wanted to give you the foundations of your melee system that you can use in your own game.
At the end you will have an awesome universal melee system. That can be changed and easily implemented into your project.
Discord: / discord
Instagram: / gabzxd
Twitch: / officialzyger
Twitter: / zygerdesigns
➤WISHLIST MY GAME: store.steampowered.com/app/16...
Video Sponsored By Unity

Пікірлер: 182

  • @unity
    @unity2 жыл бұрын

    Amazing content Zyger, really comphrehensive and clear. We love to see it ❤!

  • @koofe0

    @koofe0

    2 жыл бұрын

    lol its actual unity

  • @RedHeadphones

    @RedHeadphones

    2 жыл бұрын

    omg real unity

  • @mirorr5698

    @mirorr5698

    2 жыл бұрын

    nice ad

  • @mismatchingshoes5249

    @mismatchingshoes5249

    2 жыл бұрын

    Ya love to see it

  • @ethandominic8070

    @ethandominic8070

    2 жыл бұрын

    You guys are awesome I haven’t seen anyone support their creators like this

  • @arachnid5669
    @arachnid56692 жыл бұрын

    Really well explained and easy to follow, thanks for making!

  • @kimikazio
    @kimikazio2 жыл бұрын

    fantastic, it helped me a lot to understand animation in unity. Thanks for making this video! ;)

  • @jackslammer
    @jackslammer Жыл бұрын

    Will be using the lessons here to integrate into my own game, thank you so much for posting this.

  • @MorphingGrid101
    @MorphingGrid1012 жыл бұрын

    Thank you so much Zyger! Very cool! 👍

  • @LukaRBJJ
    @LukaRBJJ2 жыл бұрын

    Awesome video, neatly explained!

  • @justinbennett9998
    @justinbennett99982 жыл бұрын

    I found an open sourcish project thats aiming to create a custom launcher for everquest trilogy and its being ported over to unity. I REALLY appreciate the unity videos ive found because i habe NO idea ehat im doing yet and your tutorials are extremely helpful. Youve become a huge part of a dream thats coming true. Thank you.

  • @toongenie
    @toongenie2 жыл бұрын

    love this system, very easy to understand and works great! thanks for sharing

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    thanks I appreciate it !

  • @thesilentwisp
    @thesilentwisp2 жыл бұрын

    Thank you so much I'm just starting out and this is super helpful.

  • @bottomlesstopless
    @bottomlesstopless7 ай бұрын

    probably the best unity tutorial for fps melee combat ive come across, thank you.

  • @vrutantshah8266
    @vrutantshah8266 Жыл бұрын

    Thank you soo much! Finally got the animations working!

  • @phonix374
    @phonix374 Жыл бұрын

    Thank you zyger realy cool tutorial you saved my life

  • @CatsandPolygons
    @CatsandPolygons2 жыл бұрын

    Thanks a lot this really helped me!

  • @xenvo274
    @xenvo274 Жыл бұрын

    OH MY GOD I WANTED TO DELETE MY WHOLE GAME BC I COULDNT GET THE ANIMATIONS TO WORK I HAVE BEEN LOOKING FOR A SOLUTION FOR TWO WEEKS YOU'RE THE BEST

  • @baulbasauur7659
    @baulbasauur76596 ай бұрын

    exactly what i was looking for

  • @jamesclements9448
    @jamesclements9448 Жыл бұрын

    You did a great job with this tutorial. You are going to have a great career in game dev ahead of you.

  • @cfundeniable3442
    @cfundeniable3442 Жыл бұрын

    I’ve been a fitness coach for 15 years. I know nothing about game development, and I’m starting to learn. Although I’m new to game dev, I am quite experienced at teaching. You are very good teacher! Subscribed!

  • @Ytsssss364

    @Ytsssss364

    10 ай бұрын

    overall, good AttackCoolDwon... ok well - but the wp vs. wc oversight *egads* - beginner's are having enough trouble as it is - also, showing making the "Attack" trigger in the Animator Controller instead of having it prepopulated like was done later for "Hit" trigger demonstration - would have been better teaching practice. But hey. Only a teacher like me would maybe nitpick on things like this

  • @W0B0N
    @W0B0N2 жыл бұрын

    I have never done any coding but i feel like i learned something from this. Great video.

  • @ahmadgamal65

    @ahmadgamal65

    2 жыл бұрын

    You are missing out bro you never wrote any code??

  • @BeanGuyThatDoesStuff

    @BeanGuyThatDoesStuff

    Жыл бұрын

    omg

  • @lucaslessa318
    @lucaslessa318 Жыл бұрын

    Thank you very much! You are a hero!

  • @mattiusstrutton
    @mattiusstrutton2 жыл бұрын

    This was a great tutorial! For anyone confused with coroutines I encourage you to look into it. But, if you still can't wrap your head around it just yet don't get frustrated. You can also use the animator to turn on and off the weapons collider as a hack-y solution. Thank you, Zyger for making the video. I never would have thought of making the weapon hit box bigger to hit the enemies and would have spent a lot of time wondering why it wasn't working haha.

  • @TheJuggernaut.

    @TheJuggernaut.

    Жыл бұрын

    Every time I press the attack button, it does not work, what do I do? Is there a way to change the attack button to the space button?

  • @jhin28
    @jhin28 Жыл бұрын

    perfect for beginners. thank you

  • @rothhomemade
    @rothhomemade3 ай бұрын

    I will give you credit on my game's demo! thnk sooo much

  • @DaRealViso
    @DaRealViso Жыл бұрын

    For people who have the problem of it not always registering the hit, the problem is that the collider is always active so therefor is always touching the enemy. To fix this first make a public gameobject for your hitbox and then have a HitBox.SetActive(true); for when you attack and a HitBox.SetActive(false); on your reset cooldown

  • @Garb0_

    @Garb0_

    Жыл бұрын

    How, pls help

  • @trentonbeeson7132

    @trentonbeeson7132

    8 ай бұрын

    I cannot tell you how valuable this comment is

  • @DaRealViso

    @DaRealViso

    8 ай бұрын

    @trentonbeeson7132 Thanks. Happy that my brief knowledge of coding helped

  • 2 жыл бұрын

    i like your channel thanks!

  • @rogersun6184
    @rogersun6184 Жыл бұрын

    Thank you very much :)

  • @captaingames2037
    @captaingames20374 ай бұрын

    really helpful

  • @dcry1003
    @dcry10032 жыл бұрын

    hey zyger question, can i use this code combined with the code for pick up and throwing gameobjects (melee weapons)? *i dont really have a code for a pick up and throw gameObjects i just had a thought for picking up weapons and being able to use them (like you did here) and also being able to throw them for long range dmg option*

  • @mismatchingshoes5249
    @mismatchingshoes52492 жыл бұрын

    You know you’ve peeked when unity sponsors you

  • @johnathaninmanjr2629
    @johnathaninmanjr26292 жыл бұрын

    Great vid, crystal clear and easy to follow , tyvm!

  • @fogcomign
    @fogcomign Жыл бұрын

    Thank you!

  • @ChildishSoap
    @ChildishSoap2 жыл бұрын

    Thank U Soo Much I needed this for my first Game the only part im stuck in is in the animations ahah

  • @aaronludwig8150
    @aaronludwig81502 жыл бұрын

    Phenomenal.

  • @ArtisticallyGinger
    @ArtisticallyGinger2 жыл бұрын

    I see you started looking into Coroutines to make your life easier. They make your processes waaaaay easier :D

  • @pollisgaming3168
    @pollisgaming3168 Жыл бұрын

    Hi, everything worked perfectly but I was just wondering if it is necesary for the object's colliders to be on trigger since when I have them on trigger I can just walk through them. Ty for reading

  • @alphakelo
    @alphakelo2 жыл бұрын

    This was a really good tutorial and I learned a lot, is there any sort of health and damage system that you know of that would work along side this tutorial?

  • @justinbennett9998

    @justinbennett9998

    2 жыл бұрын

    Good question.

  • @Ytsssss364

    @Ytsssss364

    10 ай бұрын

    yeah - see my post above on similar question - but I'll answer here too. You need of course to have a Enemy Health Controller - a script that controls the Enemy's Health status. you attach it to your Enemy Controller. In that Enemy Health Controller script, you create a public function called DamageEnemy(float damageAmount) which defines how the Enemy takes damage. Usually it's something like: {currentHealth = currentHealth - DamageEnemy} -- sorry but youtube does not like "minus equals" using symbols you know what I mean - so then, in the Weapon Controller, when the HIT is being done, in the part where you're playing that animation controller - where the SetTrigger ("Hit") is happening - well, you actually made a hit - the enemy flinches with its "Hit" animation and "bleeds" a "Blood particle" that's instantiated. That's where you wanna then take off some Enemy|Health - so here you code something like other.gameObject.GetComponent().DamageEnemy(damage); where "damage" is defined as a float in the WeaponController script - good luck

  • @blackespectral
    @blackespectral Жыл бұрын

    thank you so much

  • @purjolokgaming8482
    @purjolokgaming8482 Жыл бұрын

    I have a slight problem, when my weapons box collider already collides with the enemys before i attack, nothing happens when i acctually do attack. I might have done something wrong. It works normally when the weapon box collied does not collide with the enemy before.

  • @GunzzYT
    @GunzzYT2 жыл бұрын

    ok, so i had this problem where my sword would swing but it was stuck in the attack animation(it wouldnt go back to idle animation). I had to click twice on my mouse btn in order to go back to idle and then i could attack again, so my solution was: Put the Anim.SetTrigger("Attack"); also in the ResetAttackCoolDown() method. That fixed it for me.

  • @234zuscoutjango9
    @234zuscoutjango92 жыл бұрын

    if i put Debug.log(other.name) in the part whereit is checked with with tag the sword collides i only get the name of my first person controller and i have no idea why

  • @DetectiveRyku
    @DetectiveRyku2 жыл бұрын

    Thank you

  • @kingofroms7224
    @kingofroms72242 жыл бұрын

    thansk for it

  • @chrismations9191
    @chrismations91912 жыл бұрын

    K ima watch this after school for my game!

  • @VkStudio_
    @VkStudio_ Жыл бұрын

    Hey great video but i wanted to make it so that when i attack that the camera shakes a little idk how to do that i could really use your help.

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    just make a camera shake script and call the shake function when you press your attack button. Brackeys has a great video on camera shake: kzread.info/dash/bejne/a3Vt28xxe9GzaMY.html

  • @Darkziss0
    @Darkziss02 жыл бұрын

    Thank!

  • @schmutzxD
    @schmutzxD2 жыл бұрын

    Really well explained, thanks for that! I tried using your method with a third person controller, and I actually got it done working quite well. I'm struggling to get a decent attack combo system done though. I tried to make a transition between the first hit animation and the first combo hit animation just like you did with the first one, using the previous attack trigger as a trigger for the second transition, but I can't seem to get it done. You would have to click LMB in just the right moment to get the transition done and sometimes for some reason the animation gets stuck and won't transition to an other animation for a very short moment(

  • @dot5527

    @dot5527

    2 жыл бұрын

    i have the exact same issue

  • @deni5368
    @deni53686 ай бұрын

    it stays in the position that i finished the animation so when i click to attack it reverses from left to right. I made the animation go from right to left. can somone pls help?

  • @benjismith2848
    @benjismith28484 ай бұрын

    Love the tutorial! Not sure if anyone else has run into this problem too but the Hit animation where the enemy gets knocked back after being hit, sometimes plays twice? tried a few different things but can't figure out whats causing it? I basically done the scripts just as the ones in this video.

  • @erincristall
    @erincristall Жыл бұрын

    I got up to the point where I have an attack animation and an enemy that goes into the idle animation, but when I actually attack the enemy, it doesn't do anything like the colliders aren't detecting. I am very confused because I pretty much just copy/pasted everything you did.

  • @aimanrazia3236
    @aimanrazia323625 күн бұрын

    Can we apply this same to third person view

  • @fox.9879
    @fox.9879 Жыл бұрын

    i have these three issues can anyone help with this error CS0119: 'Component.GetComponent()' is a method, which is not valid in the given context Assets\collisionDetection.cs(13,31): error CS0103: The name 'wc' does not exist in the current context Assets\WeaaponController.cs(34,18): error CS0428: Cannot convert method group 'GetComponent' to non-delegate type 'AudioSource'. Did you intend to invoke the method?

  • @majesticchicken3213
    @majesticchicken321310 ай бұрын

    this is really2 good

  • @AleksandarDaGr8
    @AleksandarDaGr8 Жыл бұрын

    Great tutorial! Only thing I'm a little confused on is how to have the enemy lose HP. was think it would make more sense to have the collision be handled by an enemy controller script and access a variable from the weapon called damage then if the OnTriggerEnter for if the enemy touches the swords hitbox to subtract the damage from health

  • @Ytsssss364

    @Ytsssss364

    10 ай бұрын

    naw, you're gonna have to create in your Enemy Health Controller a function where it takes the damage. Say, DamageEnemy. Then in the WeaponController, you're going to GetComponent

  • @Ytsssss364

    @Ytsssss364

    10 ай бұрын

    SORRY i used minus equals for code and it did it above as a "strikethrough" currenHealth minus equals damageAmount etc above, not strikethru lol

  • @jmiahbullfrog
    @jmiahbullfrog9 ай бұрын

    Mine doesnt show the sword, can attack and attack cool down on weapon holder

  • @tronstein6342
    @tronstein6342 Жыл бұрын

    thank's a lot:;;;

  • @brownie4672
    @brownie4672 Жыл бұрын

    hey you might not see this, but i am getting this error where it says "wc does not exist in this context." please help

  • @sleepyaj
    @sleepyaj Жыл бұрын

    Hi uhm im hoping you'll respond to this, the tutorial is really helpful so far but one tiny problem that i've been stuck on is, when i'm preparing to use the animator. No matter how many times I drag the animation into the animator- nothing seems to pop up? Did I do something wrong? I've tried clicking to select the Sword-Attack/Sword-Idle then dragging it, dragging it without selecting it and nothing.

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    This is actually a unity bug and had been for a while. I reccomend resetting unity and reopening the project. Worst case scenario you might need to re install it. But before that make sure yoy actually have the object with the animator component selected.

  • @sleepyaj

    @sleepyaj

    Жыл бұрын

    @@ZygerGFX Thank you so much! I did what you said and made an entirely new project and repeated the same steps in the video and it works! Thank you so much for responding! ;D

  • @Ytsssss364
    @Ytsssss36410 ай бұрын

    @17:13 you use "wp" for the "WeaponController" - I miss the part where you change it at random to "wc" - what gives??? like at 18:47, it's "wc" - did you make this tutorial while sitting in the WC?

  • @jojikYT
    @jojikYT2 жыл бұрын

    Aren't animation events better then coroutines in this case? Much easier to control and no timing problems.

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    yes they are i didnt bother showing those since this is more of a tutorial on getting the basic weapon mechanics. but you're totally right

  • @Omnivoid22

    @Omnivoid22

    Жыл бұрын

    Now i gotta look up animation events? If i want something to end when animation ends. thats what i need to use?

  • @alsowow
    @alsowow Жыл бұрын

    I have a problem, i have an enemy that can move and look around, but hen i give it animations it can't move or look around. any tips to prevent this?

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    make sure your animations don't alter the position of the object. That will prevent it from moving. So just remove the position changes in the animation :)

  • @syafiqaffandi4427
    @syafiqaffandi4427 Жыл бұрын

    Hi @zyger, i need some help and im hoping you see this as it is my final year project, i would like to know how i can make my AI enemy to not be able to walk through the player or the trees bcs when i activated the isTrigger, he seems to be able to pass through everything

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    you can have 2 colliders on it. One which is OnTrigger and the other that isn't. You could also write a script that checks the distance between the enemy itself and the player and makes it stop moving when it reaches a certain distance value. Best of luck

  • @scubaking4690
    @scubaking46902 жыл бұрын

    Nice video it really helped me out, but I have a question. I tried making a second attack, made a trigger for it, and just copied and pasted your code, but changed the trigger name and the input button, swordattack, and canattack. After I did it, everything seemed to work, but when I pressed the button for the second attack, it worked, but kept repeating with no way to turn it off. Could you please tell me what I messed up?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    kind of hard to tell but make sure your animation is not on loop. if you find the animation you can see if its turned to loop or not!

  • @scubaking4690

    @scubaking4690

    2 жыл бұрын

    Sorry how do I do that?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    @@scubaking4690 well in the video I make an animation and I turn of loop. but you can go on the animation and turn it off

  • @scubaking4690

    @scubaking4690

    2 жыл бұрын

    @@ZygerGFX Thank you so much it finally fixed itself. for some reason after I do the animation I have to click the button again to do other animations but that's fine. Thanks again so much!

  • @wowgames3035
    @wowgames30352 жыл бұрын

    nice

  • @JaketheMotorhead
    @JaketheMotorhead2 жыл бұрын

    I keep getting this error: InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings. Weapon_controller.Update () (at Assets/Weapon_controller.cs:13) Can you help?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    you are using the new input system. so you need to either change to the old one. or change the way your checking for input.

  • @JaketheMotorhead

    @JaketheMotorhead

    2 жыл бұрын

    @@ZygerGFX How do you change the way. I tried changing to the old one and there were compile errors in the movement.

  • @JaketheMotorhead

    @JaketheMotorhead

    2 жыл бұрын

    @@ZygerGFX how do you change the way your checking for input?

  • @bobthegaymer
    @bobthegaymer4 ай бұрын

    I Cant Drag In Da Anims And Make A New Trigger :( (i found out that i didnt select the sword and when i did and then looked in the animations they were there no worries)

  • @farasapt6579
    @farasapt6579 Жыл бұрын

    great tutorial. but at the end the coding doesn't work for me as the last minute. So at 19:01, when I type wc.IsAttacking) , an error called ' Assets\Scripts\CollisionDetection.cs(12,39): error CS1061: 'WeaponController' does not contain a definition for 'IsAttacking' and no accessible extension method 'IsAttacking' accepting a first argument of type 'WeaponController' could be found (are you missing a using directive or an assembly reference?) great tutorial but I hate coding :(

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    do you have a variable under the name "IsAttacking" ? is that how its spelt ? is it accessible ? That error basically says that this variable is either not accessible or doesn't exists ( which is usually due to spelling or the protection level of the variable)

  • @Skeltcher
    @Skeltcher2 жыл бұрын

    Im getting this error after finishing the WeaponController script. "InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings."

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    your trying to detect input using the old input system methods while your using the new one. Either change the way your checking for input or revert back to the old input system.

  • @oggy4019
    @oggy4019 Жыл бұрын

    how to do auto swing every 1 sec when holding mouse0? thanks in advance!

  • @IrfuTuber

    @IrfuTuber

    Жыл бұрын

    Input.GetMouseButton instead of Input.GetMouseButtonDown will work

  • @alphakelo
    @alphakelo2 жыл бұрын

    Hi, Im pretty new to unity, but I have copied down your script (up till 10:39) and everything seems correct but when I click nothing happens? Can someone please help?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    use debug.log to check if the function is being called. if it is then maybe something with the animations. and if not you probs not calling the function or input isnt being detected

  • @alphakelo

    @alphakelo

    2 жыл бұрын

    @@ZygerGFX Oh my god, thank you so much

  • @Art_4_Animation
    @Art_4_Animation2 жыл бұрын

    what abt the fps game?? is it canceled?

  • @GMRV533
    @GMRV533 Жыл бұрын

    at 5:25 i did the same things as u did but my sword just keeps swinging

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    is your animation set to loop ? if so disable that checkbox

  • @DayDreamSounds
    @DayDreamSounds Жыл бұрын

    very late here. When I attack the first time, canAttack doesn't become true again. It just stays unticked. I double checked code but can't find anything :(

  • @DayDreamSounds

    @DayDreamSounds

    Жыл бұрын

    Nevermind. Obviously didn't check code properly. I didn't even start the coroutine haha!

  • @Franos_official_
    @Franos_official_9 ай бұрын

    Can someone copy the script here becose it didn't work

  • @supernick7773
    @supernick77732 жыл бұрын

    Hi, i recently started coding in unity and I have copied everything from the video, until 10:26, but when I press the button, nothing happens. Do you have any fixes?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    Debug your code. Chekc whether functions get called. Whether the input actually gets called and is working. From what you said I cant tell what's wrong but just debug your code and check if things get called

  • @supernick7773

    @supernick7773

    2 жыл бұрын

    @@ZygerGFX how do I debug the code

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    @@supernick7773 I recommend researching how to do that. but you should use debug.log to send messages. you can write this in functions and you will receive a message in the console. which will tell you that the function gets called. if you don't see it, then it means it doesn't get called. which means something is causing the function not being called. you can always join the discord server and ask people in the help channel for help ! :))

  • @malcolmgruber8165
    @malcolmgruber81652 жыл бұрын

    This is a great tutorial, but I was laughing for part of it because the players capsule looks like a turd. xD

  • @dezhofman3958
    @dezhofman3958 Жыл бұрын

    Does anyone know why my mouse button isn’t working i set it to input.Getmousebutton(0) but it isn’t doing anything in my game

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    Make sure to use the old input system. And ensure there are no errors. It should be Input.GetMouseButtonDown(0)

  • @dezhofman3958

    @dezhofman3958

    Жыл бұрын

    @@ZygerGFX yeah i forgot to type down in my comment 😅 but what do yeah mean by making sure to use the old input system

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    @@dezhofman3958 well unity has 2 systems the old classic one and the new one so just double check which one your using I project settings. Also debug your code see if the function gets called and if the input is actually detected.

  • @monkeefox5997
    @monkeefox59972 жыл бұрын

    cool

  • @alsowow
    @alsowow Жыл бұрын

    How would i have the enemy lose health? I thught that you would go over it but apparently not

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    when you detect the enemy getting hit just decrease their health like health-=10;

  • @alsowow

    @alsowow

    Жыл бұрын

    @@ZygerGFX I'm relatively new to coding so if you could elaborate that would be great

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    @@alsowow well in your code you detect the enemy getting hit so if you followed the video that would be in the enemy script under OnTriggerEnter decrease the enemies health like: health -= amount; Health, is just a variable that you can set to whatever number you want and amount is either a variable or could just be a number of how much you want to decrease the health by.

  • @MaskedYemeni1
    @MaskedYemeni13 ай бұрын

    How to get Code pls i am big fan :(

  • @NotDoubleA
    @NotDoubleA Жыл бұрын

    This was such a good tutorial and i really thought i was able to pull it off, lol nope got error CS1061. i'll still like the video though.

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    what is the error ?

  • @NotDoubleA

    @NotDoubleA

    Жыл бұрын

    @@ZygerGFX This is the error code i got. "Assets\WeaponContoller.cs(26,31): error CS1061: 'GameObject' does not contain a definition for 'GetComponet' and no accessible extension method 'GetComponet' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?)

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    @@NotDoubleA you spelt it wrong .. its meant to be GetComponent not GetComponet

  • @NotDoubleA

    @NotDoubleA

    Жыл бұрын

    @@ZygerGFX oof, i didn't even notice it. thanks for that quick reply

  • @TheJuggernaut.
    @TheJuggernaut. Жыл бұрын

    Every time I press the attack button, it does not work, what do I do? Is there a way to change the attack button to the space button?

  • @quinnncy4703

    @quinnncy4703

    Жыл бұрын

    yeah, change the input from left clikc to spacebar

  • @TheJuggernaut.

    @TheJuggernaut.

    Жыл бұрын

    @@quinnncy4703 Could you elaborate?

  • @quinnncy4703

    @quinnncy4703

    Жыл бұрын

    @@TheJuggernaut. on the part that is like GetInput(mousebutton) change it to spacebar

  • @TheJuggernaut.

    @TheJuggernaut.

    Жыл бұрын

    @Quinnncy You wouldn’t mind elaborating further, would you? Like instead of which line, should I add a correct one?

  • @SenpaiMasterGD
    @SenpaiMasterGD Жыл бұрын

    i cant get the ¨hit ¨ to show do you know why @Zyger

  • @Driesipops
    @Driesipops Жыл бұрын

    I spent the better part of 9 hours trying to figure out why the animation part wasn't working... editing code, placing debugs, looking for boolean code that would work, trying to put the script onto different assets to see if that would work... only to realize that I had accidentally made a bool instead of a trigger. Don't be a fool, don't be like good ol' Dries over here, make sure to check that your triggers are actually triggers before wasting 9 hours of your life.

  • @ZygerGFX

    @ZygerGFX

    Жыл бұрын

    Ah that sucks. I'm pretty sure I've done that before too... 😅 at least now you know

  • @fragdummy

    @fragdummy

    Жыл бұрын

    you just saved me

  • @nytro6049
    @nytro60492 жыл бұрын

    hi Zyger I have a question when I have three animations and I would like them to always be use one of them randomly how can i do it. thank you for the answer.

  • @jayengel9012

    @jayengel9012

    2 жыл бұрын

    A very simple way is creating a trigger for each attack animation (attack1,attack2 etc..) and then you you make a list or an array in your scripts that contains a string for each trigger : ["attack1","attack2" etc..], now you just have to do like in the video, but instead of using just : settrigger("attack"), you will do something like this : settrigger(attackList[random.randint(0,attackList.Length-1)]), this could also be brought further with using an animation int id state machine where you can easily switch randomly animation id and then aply a global trigger to the trigger which isn't too hard, tell me if you need more help

  • @SmashBros4339
    @SmashBros43392 жыл бұрын

    6:53: When I attack, the blue bar at the bottom of my sword attack doesn't go away it just stays there, and when i click again, it goes back to normal but when i attack, the blue bar still is there and i have to keep clicking again. ANY FIX?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    you probably set up your animations wrong. if it doesn't continue to the next animation its because there is something wrong with your transition back. ensure there's nothing on that transition that's stopping it from going back. alternatively redo the animations. Not really sure since I cant see it.

  • @SmashBros4339

    @SmashBros4339

    2 жыл бұрын

    @@ZygerGFX nvm I didn’t need the attack trigger for the transaction from attack to idle

  • @DwuhTypufGranie
    @DwuhTypufGranie Жыл бұрын

    11:17

  • @mlp4266
    @mlp426620 күн бұрын

    1:09 = Ad ends 13:27 = I need enemy AI

  • @Backisbackneverlaugh
    @Backisbackneverlaugh4 ай бұрын

    its hard zyger i cant do it

  • @bisutowastaken
    @bisutowastaken Жыл бұрын

    14:00

  • @bisutowastaken
    @bisutowastaken Жыл бұрын

    6:13

  • @prrithwirajbarman8389
    @prrithwirajbarman83892 жыл бұрын

    Found ya

  • @kokorodev1219
    @kokorodev1219 Жыл бұрын

    i need 3rd person

  • @mlp4266
    @mlp426618 күн бұрын

    13:24 First need to make enemy AI

  • @GameBoy-ur9mb
    @GameBoy-ur9mb2 жыл бұрын

    SECOND BRACKEYS PLAS!

  • @cosmocourtois3345
    @cosmocourtois33452 жыл бұрын

    I'm probably not the first to say this, but it is so nice to hear a girl talk for once in a male-dominated platform, especially in the game development community. Thanks!

  • @stopmotionnoob5053
    @stopmotionnoob50535 ай бұрын

    Somone how i have 26 errors

  • @takenkills9266
    @takenkills92662 жыл бұрын

    wowo 10 seconds ago

  • @alphakelo
    @alphakelo2 жыл бұрын

    How could I use this to kill an enemy?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    well in the video I showed how enemies can detect an attack from the player. in my case I make them play an animation and spawn some particles. but if you want to deal damage do that there. and what you do will depend what sort of health system you have implemented.

  • @alphakelo

    @alphakelo

    2 жыл бұрын

    @@ZygerGFX Ok, Thank You.

  • @alphakelo

    @alphakelo

    2 жыл бұрын

    @@ZygerGFX Sorry, one last question what particle did you use?

  • @ZygerGFX

    @ZygerGFX

    2 жыл бұрын

    @@alphakelo dont apologise xD. what do you mean by what particle ? its one I made myself

  • @alphakelo

    @alphakelo

    2 жыл бұрын

    @@ZygerGFX ohhh ok, (I'm new too unity and Coding thought that particles were a prebuilt thing lol)

  • @MugiwaraLevi560
    @MugiwaraLevi5602 жыл бұрын

    im the first like lets go

  • @miloverreijt6396

    @miloverreijt6396

    2 жыл бұрын

    No you're 2nd

  • @startandplay6706

    @startandplay6706

    2 жыл бұрын

    hey friend can you make this video in a new way for 2021..., kzread.info/dash/bejne/k56uqs2Sn9qTo9I.html&ab_channel=DonHaulGameDev-Wabble-UnityTutorials

  • @QuadDamage3
    @QuadDamage32 жыл бұрын

    Nice tutorial, but are you **in hurry** to somewhere? Clicking so quickly through scripts felt nearly criminal.

  • @monkeyrobotsinc.9875
    @monkeyrobotsinc.9875 Жыл бұрын

    this is nice but theres so much extra BS about "you can do it like this or like this or i like to do it like this" which is just too much babble. and overall talking just too fast anyway. i recommend chilling out some. this is too hyper.

Келесі