Melee Combat & Weapon System - Unity Beginner Tutorial

Поділитися
Вставка
  • Опубліковано 29 лис 2024

КОМЕНТАРІ • 183

  • @unity
    @unity 2 роки тому +270

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

  • @cfundeniable3442
    @cfundeniable3442 Рік тому +2

    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 Рік тому +1

      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

  • @xenvo274
    @xenvo274 Рік тому +7

    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

  • @justinbennett9998
    @justinbennett9998 2 роки тому +3

    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.

  • @jojam.o
    @jojam.o Рік тому +1

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

  • @W0B0N
    @W0B0N 3 роки тому +7

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

    • @ahmadgamal65
      @ahmadgamal65 2 роки тому +2

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

    • @Cat_6921
      @Cat_6921 Рік тому

      omg

  • @DaRealViso
    @DaRealViso Рік тому +8

    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_ Рік тому +1

      How, pls help

    • @trentonbeeson7132
      @trentonbeeson7132 Рік тому +1

      I cannot tell you how valuable this comment is

    • @DaRealViso
      @DaRealViso Рік тому

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

  • @mattiusstrutton
    @mattiusstrutton 2 роки тому +11

    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. 2 роки тому

      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?

  • @jackslammer
    @jackslammer Рік тому +1

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

  • @jamesclements9448
    @jamesclements9448 2 роки тому +12

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

  • @mismatchingshoes5249
    @mismatchingshoes5249 2 роки тому +2

    You know you’ve peeked when unity sponsors you

  • @ArtisticallyGinger
    @ArtisticallyGinger 3 роки тому +3

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

  • @baulbasauur7659
    @baulbasauur7659 11 місяців тому +1

    exactly what i was looking for

  • @arachnid5669
    @arachnid5669 2 роки тому +4

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

  • @toongenie
    @toongenie 2 роки тому +2

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

    • @ZygerGFX
      @ZygerGFX  2 роки тому +1

      thanks I appreciate it !

  • @GunzzYT
    @GunzzYT 2 роки тому +2

    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.

  • @phonix374
    @phonix374 2 роки тому +1

    Thank you zyger realy cool tutorial you saved my life

  • @kimikazio
    @kimikazio 2 роки тому +2

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

  • @thesilentwisp
    @thesilentwisp 3 роки тому +2

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

  • @alphakelo
    @alphakelo 2 роки тому +7

    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 Рік тому

      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

  • @cosmocourtois3345
    @cosmocourtois3345 2 роки тому +8

    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!

  • @homemadeswtor
    @homemadeswtor 8 місяців тому

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

  • @nathanielgmoyon4772
    @nathanielgmoyon4772 3 місяці тому

    Thank you for this amazing tutorial

  • @schmutzxD
    @schmutzxD 2 роки тому +9

    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

  • @MorphingGrid101
    @MorphingGrid101 3 роки тому +2

    Thank you so much Zyger!
    Very cool! 👍

  • @vrutantshah8266
    @vrutantshah8266 Рік тому

    Thank you soo much! Finally got the animations working!

  • @Driesipops
    @Driesipops 2 роки тому +3

    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  2 роки тому

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

    • @fragdummy
      @fragdummy Рік тому

      you just saved me

  • @ChildishSoap
    @ChildishSoap 2 роки тому +1

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

  • @LukaRBJJ
    @LukaRBJJ 2 роки тому +1

    Awesome video, neatly explained!

  • @MaskedYemeni1
    @MaskedYemeni1 7 місяців тому +2

    How to get Code pls i am big fan :(

  • @back2jump
    @back2jump Місяць тому

    Hey I'm pretty new to coding and making games but your tutorials are perfect do you think I could combine this and the steam netcode tutorials for pvp?

  • @purjolokgaming8482
    @purjolokgaming8482 Рік тому +2

    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.

  • @pollisgaming3168
    @pollisgaming3168 2 роки тому +1

    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

  • @benjismith2848
    @benjismith2848 9 місяців тому

    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.

  • @rogersun6184
    @rogersun6184 2 роки тому +1

    Thank you very much :)

  • @CatsandPolygons
    @CatsandPolygons 2 роки тому +1

    Thanks a lot this really helped me!

  • @chrismations9191
    @chrismations9191 3 роки тому

    K ima watch this after school for my game!

  • @Pigga_Prime
    @Pigga_Prime Рік тому +1

    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  Рік тому +1

      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: ua-cam.com/video/9A9yj8KnM8c/v-deo.html

  • @jojikYT
    @jojikYT 2 роки тому +2

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

    • @ZygerGFX
      @ZygerGFX  2 роки тому +1

      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?

  • @lucaslessa318
    @lucaslessa318 Рік тому

    Thank you very much! You are a hero!

  • @canalataquerapido
    @canalataquerapido 2 роки тому +1

    i like your channel thanks!

  • @AleksandarDaGr8
    @AleksandarDaGr8 Рік тому +1

    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 Рік тому

      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 Рік тому

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

  • @farasapt6579
    @farasapt6579 Рік тому +1

    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)

  • @Franos_official_
    @Franos_official_ Рік тому +2

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

  • @aaronludwig8150
    @aaronludwig8150 2 роки тому +1

    Phenomenal.

  • @dcry1003
    @dcry1003 2 роки тому +2

    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*

  • @johnathaninmanjr2629
    @johnathaninmanjr2629 2 роки тому +2

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

  • @malcolmgruber8165
    @malcolmgruber8165 3 роки тому +2

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

  • @Ytsssss364
    @Ytsssss364 Рік тому

    @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?

  • @sleepyaj
    @sleepyaj 2 роки тому +2

    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  2 роки тому

      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 2 роки тому

      @@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

  • @aimanrazia3236
    @aimanrazia3236 5 місяців тому

    Can we apply this same to third person view

  • @scubaking4690
    @scubaking4690 2 роки тому +2

    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 роки тому +3

      @@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 роки тому +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!

  • @fogcomign
    @fogcomign Рік тому

    Thank you!

  • @blackespectral
    @blackespectral Рік тому

    thank you so much

  • @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.

  • @captaingames2037
    @captaingames2037 9 місяців тому

    really helpful

  • @levivalgaerts6813
    @levivalgaerts6813 Місяць тому

    Can someone pleas help i made a mistake with the code but can't vind it.

  • @BobTheGreatGoober
    @BobTheGreatGoober 9 місяців тому

    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)

  • @fox.9879
    @fox.9879 2 роки тому

    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?

  • @oggy4019
    @oggy4019 2 роки тому

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

    • @IrfuTuber
      @IrfuTuber 2 роки тому

      Input.GetMouseButton instead of Input.GetMouseButtonDown will work

  • @deni5368
    @deni5368 11 місяців тому

    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?

  • @majesticchicken3213
    @majesticchicken3213 Рік тому

    this is really2 good

  • @JaketheMotorhead
    @JaketheMotorhead 2 роки тому +1

    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 роки тому +1

      @@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?

  • @NotDoubleA
    @NotDoubleA 2 роки тому +1

    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  2 роки тому

      what is the error ?

    • @NotDoubleA
      @NotDoubleA 2 роки тому

      @@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  2 роки тому +1

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

    • @NotDoubleA
      @NotDoubleA 2 роки тому

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

  • @jmiahbullfrog
    @jmiahbullfrog Рік тому

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

  • @DetectiveRyku
    @DetectiveRyku 2 роки тому

    Thank you

  • @kingofroms7224
    @kingofroms7224 2 роки тому

    thansk for it

  • @234zuscoutjango9
    @234zuscoutjango9 2 роки тому

    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

  • @DwuhTypufGranie
    @DwuhTypufGranie 2 роки тому +1

    11:17

  • @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!

  • @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

  • @Darkziss0
    @Darkziss0 2 роки тому

    Thank!

  • @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.

  • @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 :)

  • @brownie4672
    @brownie4672 2 роки тому

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

  • @roscoeroly
    @roscoeroly 4 місяці тому

    Awesome video Gabi. "Cooldwon" caused my OCD to flare up and I almost got an aneurism, but apart from that 10/10.

  • @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

  • @Skeltcher
    @Skeltcher 2 роки тому

    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.

  • @GameBoy-ur9mb
    @GameBoy-ur9mb 2 роки тому +2

    SECOND BRACKEYS PLAS!

  • @dezhofman3958
    @dezhofman3958 2 роки тому

    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  2 роки тому

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

    • @dezhofman3958
      @dezhofman3958 2 роки тому

      @@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  2 роки тому

      @@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.

  • @alphakelo
    @alphakelo 2 роки тому

    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

  • @tronstein6342
    @tronstein6342 2 роки тому

    thank's a lot:;;;

  • @sdvilhidfhvs
    @sdvilhidfhvs 3 роки тому

    what abt the fps game??
    is it canceled?

  • @SenpaiMasterGD
    @SenpaiMasterGD Рік тому

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

  • @TheJuggernaut.
    @TheJuggernaut. 2 роки тому

    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 2 роки тому

      yeah, change the input from left clikc to spacebar

    • @TheJuggernaut.
      @TheJuggernaut. 2 роки тому

      @@quinnncy4703 Could you elaborate?

    • @quinnncy4703
      @quinnncy4703 2 роки тому

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

    • @TheJuggernaut.
      @TheJuggernaut. 2 роки тому

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

  • @supernick7773
    @supernick7773 2 роки тому

    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 ! :))

  • @prrithwirajbarman8389
    @prrithwirajbarman8389 2 роки тому

    Found ya

  • @Creep-_eye
    @Creep-_eye 9 місяців тому

    its hard zyger i cant do it

  • @wowgames3035
    @wowgames3035 2 роки тому

    nice

  • @bisutowastaken
    @bisutowastaken 2 роки тому

    14:00

  • @nytro6049
    @nytro6049 2 роки тому

    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

  • @bisutowastaken
    @bisutowastaken 2 роки тому

    6:13

  • @monkeefox5997
    @monkeefox5997 3 роки тому

    cool

  • @SmashBros4339
    @SmashBros4339 2 роки тому

    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 роки тому +1

      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

  • @kokorodev1219
    @kokorodev1219 2 роки тому

    i need 3rd person

  • @stopmotionnoob5053
    @stopmotionnoob5053 10 місяців тому

    Somone how i have 26 errors

  • @alphakelo
    @alphakelo 2 роки тому

    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)

  • @QuadDamage3
    @QuadDamage3 2 роки тому

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

  • @user-bj9vk1wl6q
    @user-bj9vk1wl6q 2 роки тому +2

    code is so poop

    • @quinnncy4703
      @quinnncy4703 2 роки тому

      then why did you watch the video?

  • @Al3bassy
    @Al3bassy 3 роки тому +1

    wowo 10 seconds ago