Dealing damage to AI using hitboxes, ragdolls, and healthbars in Unity [AI #02]

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

КОМЕНТАРІ • 96

  • @ravipandya198
    @ravipandya198 3 роки тому +26

    Only channel that's focus on real gaming thing .

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

      yep

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

      It's also refreshing to hear "we can just go with the basic settings and tune these later"
      Many tutorials just focus on fine-tuning everything right away and makes you forget the bigger picture.

  • @iadeb-lj1ip
    @iadeb-lj1ip 3 роки тому +4

    this channel is PURE GOLD
    Everything is well explained, and these cut-less records makes each step easier to understand and follow
    please keep making these amazing tutorials, i lov u

  • @oilyza
    @oilyza 3 роки тому +18

    Legendary as always man, its like getting a top tier AAA asset for free.

  • @ryan5882
    @ryan5882 3 роки тому +12

    Honestly the best tutorials I have watched man keep it up you're going to be big soon I can tell.

  • @r1pfake521
    @r1pfake521 3 роки тому +6

    15:40 Im not sure if you are aware of this but the material property will create a new material instance every time, so this code causes a memory leak. The sharedMaterial property returns the "original" material, but this would change the color of every enemy, so the solution here is to either write a custom shader or use MaterialPropertyBlock to change the color per Renderer

  • @tedsmall5360
    @tedsmall5360 3 роки тому +6

    Dude, you are killing it! Great tutorial, keep it up please!

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

      Thank you Ted!

    • @FelineRaptor-gv4te
      @FelineRaptor-gv4te 2 роки тому

      @@TheKiwiCoder But you could have just used the default unity slider for making the health bar by right clicking on the canvas > UI > Slider. done. then you can adjust its value via script by using slider.value

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

    Hey mate wanted to let you know that these are among the best Unity tutorials I have ever seen. Thank you so much for that ace content!

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

    I am coming back to your videos to ameliorate my project and it always works!

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

    Thank you for your tutorial. For the hitbox effect (16:37), does the material matter?
    The object which I applied the skinnedMeshRenderer like how you did just stays in white color.
    So I deleted the skinnedMeshRender Component and replaced all the "skinnedMeshRenderer" in the script with "MeshRenderer" instead. The problem seems to be solved then.
    I was using a primitive object to test the result.

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

    How do you get it to flash if you're already using emissions for something else? The model I'm using has a texture and uses URP / Lit and the emission is already being used on the parent object which handles the glow of the eyes.

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

    All I gotta say is you're awesome man, I love your tutorials!

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

    Thank you! this is the best tutorial series I've ever seen on this topic, in-depth, concise and very cool :). And I was just doing a research recently speculating whether I should buy another character controller asset or create my own (I already have a commercial controller but could not extend it to my needs). I hope you will continue. Thanks again! P.S. adding melee features will make videos even more interesting ;)

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

    You absolute legend! this is the only tutorial that worked for me, thanks!

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

    You forgot to disable the ai following you when dead, I implemented GetComponent().enabled = false; in Die(); function in "Health" script to fix this issue.

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

    Sweet. Looking forward to try it myself.

  • @programmer2AG
    @programmer2AG 7 годин тому

    15:41 hole up wait a minute, how does that automatically activate the emission and increase the intensity you only assigned the color right? how does that work?

  • @thebulletkin8393
    @thebulletkin8393 6 місяців тому

    Was the rest of this made by you also? We seem to be jumping into an existing project but I'm keen to see how that was put together

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

    Hey, great content! I have learned a lot from watching your videos. I have a question though, I'm now trying nav mesh (Unity 2022, I assume the nav mesh is an updated version here) and can't apply knockback on rigidbodies. I mean they cancel each other I guess, conventional "enemyRigidbody.AddForce(knockbackDirection * power, ForceMode.Impulse);" method doesn't work. Do you know how I can apply a knockback/ish-like effect on enemies while using nav mesh?
    Thank you for your time in advance, have a great day!

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

    This is great, exactly what I needed for a project I'm working on. Thanks for sharing😃

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

    I really enjoyed this gameplay. Saved to favorites!

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

    Hi, my ragdoll isnt realy working. Everything flyes around after I created the ragdoll. Just the spine is chasing me. After a minute a tube and not my ai was chasing me

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

    Awesome tutorial, but I've got a little problem. at 9:49 when you copy and change the rigidbodies to hitboxes, because I followed Brackeys gun tutorial, I am not sure what to change. Any ideas?

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

    Do you have a clever solution of handling area damage (sphere check) with such a hitbox system?

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

    Since you made hitboxes,how would you do a different headshot damage for instance? Thanks in advance.

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

    Hey Great Tutorial!!! , Can you please share the Code or make a tutorial for RaycastWeapon Script?

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

    You can instead getcomponent recttransform use var rt = transform as RectTransform

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

    Is good like always being watching your videos 😎

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

    Hiya, Ive got to the final part now thank you so much Kiwi Coder, my characters only appear the white now tho like the materials not working now, any ideas? :)

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

    Hello good first congratulations for the tutorials the best that I found, I have a question would it be useful for the asset Pro Military? Thanks.

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

      This series has mostly been geared towards TPS rather than FPS. But there is a lot of overlap for sure.

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

      @@TheKiwiCoder Thanks, but could it be useful? is that there are no tutorials to implement an AI with Pro Military and it is a pity, it would be too much to ask you if you could do a tutorial on how to implement an AI for Pro Military? I really liked your AI.

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

    I just spent more (and frustrating) time than I'd like to admit troubleshooting why my guy would break upon shooting and it was because I had 9:52 outside of the if statement. As soon as I moved it to the correct place, everything worked without issue.

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

    Very helpful, thank you.

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

    Can you somehow make a health bar UI that is fixed let's say to the bottom of the screen without the need of a target part in the code/ui?

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

    Thanks for the hit effect, it´s was so easy to implement

  • @lordalfred
    @lordalfred 9 днів тому

    I have a problem when I use aply force on a ragdoll it moves out of enemy transform and when I come close to the ragdoll it doesn't render it. Any advices?

    • @TheKiwiCoder
      @TheKiwiCoder  8 днів тому

      It’s getting culled from the view frustrum based on the renderer bounds

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

    the doll goes flying 😆😆

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

    I have a question, does this work with non raycast?

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

    I'm having trouble with cinemachine's camera and the UI health bar. Seems that the worldToScreenPoint returns different when it's a normal camera (which is working fine) but can't get working with the cinemachine's. It just keep moving around and don't keep in the targets position. Does it happened to somebody? And how could I fix it? Thank you

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

    Did he do a toutorial about when hes applying the force to a rigidbody in 7:57 as I rewatched older videos and cant seem to find it

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

    is there anyway to do use the hitboxes with a sword edit : nvm if figured it out

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

    Awesome bro, AAAAAAAA+ GAME TUTORIAL

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

    This strafe walking anims seems like different from the main tps shotter videos. How it did, did you use another anims? Can you share anims with us?

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

      I made these in blender, both the Unity and project files are available via Patreon: patreon.com/thekiwicoder

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

    When I apply the Universal Render Pipeline/lit shader to my material everything using that material turns pink, I have tried the common fix of upgrading my project materials but that still didnt work, if I change my materials back to the standard shader everything goes back to normal but I need to use UPR in order to add the emission, any suggestions?

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

      if you already done "update materials to urp pipeline" in Edit -> Render pipeleine -> etc... make sure you have in "Project settings -> graphics -> scriptable render [...]", one selected or if it was one there, you still have'it there... Some times when you import packages, that config may be removed or changed by external sources.

  • @a.technology1446
    @a.technology1446 3 роки тому

    I find ur tu very helpful, thank you ❤️

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

    Hello Sir.. I am facing a problem when I import a character from blender to unity... When I attache Animation Rigging setup... Mesh Start floating in air and if I attach weapon or something It shows error of saying weapon Slot transform is not found in human description.... What's the issue

  • @kyoseoul
    @kyoseoul 6 місяців тому

    17:14 Enemy accends to heaven but comes back

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

    HELP, when I copy and paste the AIAgent and shoot the new AiAgent it the first AIAgent takes damage instead and when he is killed it gives me a no reference error

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

    if my rig dsnt has elbows ands right left hips what i do? i use mixamo rig

  • @maitrykotak3703
    @maitrykotak3703 6 місяців тому

    please give a link if u had worked on complete third person shooter game,,,as i am new to this...n this channel i shelping me a lot

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

    KiwiCoder wanted to know if the next video you were going to upload from the behavior tree for basic AI is in your uploaded patreon or you haven't finished it yet, because if you're uploading your content there, right now I'm taking out my wallet, I really learn a lot with you bro, your content is addictive for people who love programming

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

    thankyou so much my character is also going on top of enemy head, after that i set , is kinematic true, now it is working.

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

    Love from India

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

    Tip for similar beginners like me, but if there is a easy way please inform me.
    if your enemy have more than one materials on it then use this.
    private void Update()
    {
    blinkTimer -= Time.deltaTime;
    float lerp = Mathf.Clamp01(blinkTimer / blinkDuration);
    float intensity = (lerp * blinkIntensity) + 1.0f;
    // i have two material so i used it two times
    // materials[indexofmaterial]
    skinnedMeshRenderer.materials[0].color = Color.white * intensity;
    skinnedMeshRenderer.materials[1].color = Color.white * intensity;
    }

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

    Join your patreon today, thanks for awesome tutorials, but please zoom the code window for my old eyes a little bit.

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

      Thank you, much appreciated! 🙏 I will make sure to zoom in future vids 🔍

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

    I'm using a Trigger instead of a raycast since I'm using a melee system. how could I make this work with my melee system?

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

      Hey you could try swapping the trigger for a physics overlap check each frame on the melee instead

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

    28:09 the bar is display above player, now i want the part player hides it display behind player in that case, how to do that?

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

    Kiwi please tell how tp add mobile inputs?

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

    KiwiCoder when you release your next video of the AI Enemies, your absence of content is felt in the community, more than someone as talented as you bro uu, I hope your return soon bro.

  • @王一次缘结一次绳
    @王一次缘结一次绳 Рік тому

    Can the gun aim to sky or ground? how?Rig is too hard

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

    Hi, my model's hitboxes are only sometimes registering Raycast hits. What can it be? I've tried both continuous and discrete collision detection on the RBs, but it's the same.
    How would you go about tracing this? So far I've tried exaggerated impact effects, but... it's not helping - it simply doesn't register hits sometimes, for some mysterious reason.

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

      Hi I am also facing the same issue. I use raycast from center of the screen and it just passes the colliders. If u have found any solution pls share 🙏

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

    Added ragdoll to my enemy, now he moves as fast as Sonic the hedgehog. Had to delete him entirely and reconfigure him again. fml, I should've created a copy to test first.

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

    10:41 just saving my time :)

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

    8:52 What about getting the root gameobject with the health component on it?

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

      That would work too! I thought it was easier to pass the health to the hit box as they can be at different levels in the hierarchy.

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

    How do I make the UI not appear when the agent is behind a wall?

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

      Keep some visibility information on the Ai if it can see the player (or vice Versa) by raycasting periodically or some other means. The use this to hide/show the ui

  • @RichardCheese-go2rh
    @RichardCheese-go2rh Рік тому

    How do I get the Raycast Weapon script or what is that?

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

      Hey, it’s covered in the previous TPS series, Episode #05

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

    can you please make a tutorial on how I can make a ragdoll enemy which follow player

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

      Cool topic, thanks for the suggestion :) try searching for powered rag dolls in the meantime.

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

      @@TheKiwiCoder oooh thank you soo much!!

  • @3bomb
    @3bomb Рік тому

    I love you.

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

    future me. You're at 13:00

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

    Does this work with projectile shooting

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

      Should do yes! The principle is the same. Instead of raycast though listen for OnCollision/Trigger Enter events.

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

    dawload progect plesssssssse