Aiming with Inverse Kinematics (IK) and Animation Rigging | Gun Series 12 | Unity Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ส.ค. 2024
  • In this tutorial, learn how you can always have your character perfectly aim at their target without needing a million animations! We'll review the PlayerIK first introduced in Part 1 of the series and update the aiming to properly aim at the crosshair!
    💸 Ongoing sales 💸
    ⚫ Check out the latest Humble Bundles www.humblebundle.com/software...
    ⚫ Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! assetstore.unity.com/publishe...
    ⚫ Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
    👨‍💻 As always, all code from this video is available on GitHub: github.com/llamacademy/script...
    📚 Resources:
    ⚫ Mixamo (free animations): www.mixamo.com/#/
    ⚫ Rifle Animation Pack Used: assetstore.unity.com/packages...
    ⚫ Full Series Playlist: • Shooting, Simple Sprea...
    ⚫ Animation Rigging Documentation: docs.unity3d.com/Packages/com...
    ⚫ Multi-Aim Constraint: docs.unity3d.com/Packages/com...
    ⚫ Unity IK: docs.unity3d.com/Manual/Inver...
    ⚫ Animator Scripting Reference: docs.unity3d.com/ScriptRefere...
    ⚫ Runtime Rig Forum Post: forum.unity.com/threads/gener...
    ❤ Believe in LlamAcademy's mission and have received value from the videos? Become a Patreon Supporter or TH-cam Member:
    ⚫ Patreon: / llamacademy
    ⚫ TH-cam Member: / @llamacademy or click the Join button on any video
    📱 Let's stay connected
    TH-cam: / llamacademy
    Patreon: / llamacademy
    Facebook: / llamacademyofficial
    Twitter: / thellamacademy
    TikTok: / llamacademy
    Instagram: / llamacademy
    ----
    Most tutorials come from knowledge gained making survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.
    I also have some Unity Assets: assetstore.unity.com/publishe...
    Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
    #unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment
    Chapters:
    00:00 Topic Introduction
    01:10 What is Inverse Kinematics? Using it in Unity for Gun Hand Placement
    03:05 The Animation Rigging Package
    03:35 Install and Set up Animation Rigging for Aiming a Third Person Character
    08:08 Add Aiming Animation & Avatar Mask
    10:00 Gun Placement
    10:52 Final Animation Rigging Configuration
    12:04 Inverse Kinematics Script - PlayerIK.cs
    15:05 Place Inverse Kinematic Transforms
    16:49 Finding the Inverse Kinematics Transform - PlayerGunSelector.cs
    17:45 Move IK code to PlayerIK.cs. Play Animation based on Gun Type
    18:53 Move Aim Transform Based on Camera - PlayerAction.cs
    20:30 Demo with Animation Rigging and IK
    20:57 Limit Camera Movement to Roughly Match Animation Rigging Constraints - ThirdPersonController.cs
    22:26 Final Demo, Closing Thoughts, & How to Support LlamAcademy

ความคิดเห็น • 46

  • @SB-jx6ox
    @SB-jx6ox ปีที่แล้ว +7

    This is exactly the type of tutorial I've been looking for on IK/animation rigging. Thank you for making this!

  • @arthurjvnb
    @arthurjvnb ปีที่แล้ว +2

    Finally some good IK material to learn from! :D

  • @Hasoon-ry8pu
    @Hasoon-ry8pu ปีที่แล้ว +2

    This is the best channel that gives useful content, and it seems that you are a specialist in the field of games, and will you create content about
    Unity, bolt

  • @RST-XIII
    @RST-XIII 11 หลายเดือนก่อน

    This is a great series. It’d be cool to see how you’d make an option for semi-automatic firing weapons.

  • @Amiranx
    @Amiranx ปีที่แล้ว +3

    Best channel in the world

  • @shadowartz9968
    @shadowartz9968 ปีที่แล้ว +1

    Thanks for the amazing tutorials, it’s a big help for a personal project.
    Question, how would I go about making a gun essentially have more than one barrel for the ray casts to originate from? Trying to making a Gatling-esc gun for a sci-fi game that I’m working on.

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      Ooo tricky one. For my minigun I cheated on this by having it only ever fire from the same position and the spinning animation + bullet spread kind of hid that.
      I guess you could change the ParticleSystem ShootSystem to be ParticleSystem[] ShootSystems and use GetComponentsInChildren() instead of just GetComponentInChildren() to give you all of the particle systems that are positioned at the tip of each barrel of your sci fi gun. Then when you do GetRaycastOrigin() you could just choose a random one (or go in some order) to use as the Raycast origin. Just have to also make sure you play the right one as you shoot as well.

  • @Jzrz369
    @Jzrz369 8 หลายเดือนก่อน

    Brother..Como le hago para que detecte el hueso de otro avatar y no el de arnature?es que me da errores

  • @Sirandy12
    @Sirandy12 วันที่ผ่านมา

    Sorry, when rotating to the right my character goes limitless and ignores the clamp, what do I do?

  • @alsadeeroffice314
    @alsadeeroffice314 ปีที่แล้ว

    Hi. Thank you for this video.. Qustion: i want to make an FPS game with full body do you think you can help. It would be nice if you do

  • @Tom-ll5qw
    @Tom-ll5qw ปีที่แล้ว +1

    thanks for the shout out :) out of curiosity, do you mention your current goals with the series on like twitter or anything? it'd be really helpful to know what you plan to cover, but I can't seem to find much info about it

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว +1

      The only place I published the future goals of the series is on the GitHub repo in the readme, but that didn't have exactly all of them.
      I've covered most of the initial scope for the series now. I think only bullet penetration and animated guns are left from my initial list now.

    • @Tom-ll5qw
      @Tom-ll5qw ปีที่แล้ว +1

      ​@@LlamAcademy ty for the heads up! have you considered looking into saving / loading at all? with all the scriptable objects i can see it being a struggle to implement, which i guess is all the more reason to cover it. just an idea :)

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว +1

      @Tom-ll5qw I did cover a save/load system while ago th-cam.com/video/mntS45g8OK4/w-d-xo.html. Not directly in the series but that covered the basics. Though, it might be worthwhile to talk about it in the series with like a menu screen so it retains your load out and stuff and we can remove the Escape menu from this scene 🧐

    • @Tom-ll5qw
      @Tom-ll5qw ปีที่แล้ว

      @@LlamAcademy tyty ill go through that once im fully caught up with the series. the attachment video has me a bit stumped rn but im getting there!

    • @Tom-ll5qw
      @Tom-ll5qw ปีที่แล้ว

      ​@@LlamAcademy hey!! i ended up going with a homebrew approach for the attchment system - do you think i could email you to ask for some advice on the architecture side of things? it does kinda work as it is now, however i feel like a strong design pattern or the like would really elavate it; currently its a bit like not knowing about events, and instead making everything a singleton. some pointers would be really amazing :)

  • @helloyou191
    @helloyou191 ปีที่แล้ว

    Hello! Very nice tutorials and keep going on!
    Do you happen to have a tutorial on how to implement a refund system on In-app-purchases? And how should IAP purchases be handled? Should they be included in the encrypted save file on user's phone?
    Thank you!

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว +1

      I do not have one specifically for refunds, but I do have a pretty in-depth Unity IAP video: th-cam.com/video/V-7R4IhS7E8/w-d-xo.html
      Unity IAP handles the vast majority of IAP for you and makes it where you can focus on the important things: setting up the items and presenting them to the players

    • @helloyou191
      @helloyou191 ปีที่แล้ว

      @@LlamAcademy Thanks for the reply! I followed your tutorial there but there seems to be a problem on the second load of the scene that has the IAP Store. For example: I load the scene that has the IAP Store, then i go to another scene, and then I go back to the scene that has the IAP Store and there's the "StoreIconProvider has already been initialized!" error. Do you happen to know how this can be solved?

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      @@helloyou191 ​ @helloyou191 Yup! The StoreIconProvider can only be initialized once. So you'll want to put it on a scene that is only loaded one time. In that video we're only dealing with 1 scene there wasn't an issue. The way I handled it in my game was to put all "Providers" on a loading/splash screen that is the first scene loaded. All that scene does is load the main menu scene, but guarantees the setup of these "providers" happens before we land anywhere and that they are initialized only once.

    • @helloyou191
      @helloyou191 ปีที่แล้ว

      @@LlamAcademy ah I see now, thank you for your feedback!

  • @miransheix3351
    @miransheix3351 ปีที่แล้ว

    cool, can you please make a video about texture cutter(ear clipping) the way that rainbow six use for wall destruction plssss

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      I can try to research how that was done, but I haven't played rainbow six and don't really know how that is achieved today

  • @RevelationRealm001
    @RevelationRealm001 ปีที่แล้ว +1

    Please make a system or ai like wwz aftermath . I am curious to know about how zombies are working in that game. Please please make a video on it

  • @user-qr5dw5pj2d
    @user-qr5dw5pj2d 4 หลายเดือนก่อน

    What if the player aim the foot himself?Is the posture correct?

  • @brodakarat6340
    @brodakarat6340 6 หลายเดือนก่อน

    if i have no keyframed animation in my human rig, how can i preview animation rigging? like my rig is 100% procedural. it seems weird they attach their preview onto the built in keyframe preview instead of making their own seperate button because wether or not you use any keyframed animation shouldnt effect the ability to preview procedural animation

    • @LlamAcademy
      @LlamAcademy  6 หลายเดือนก่อน

      Animation Rigging is built on top of the Animation system so it requires the animator: docs.unity3d.com/Packages/com.unity.animation.rigging@1.1/manual/RiggingWorkflow.html

  • @maitrykotak3703
    @maitrykotak3703 7 หลายเดือนก่อน

    is there any way to change gun model on button click as i have to load different guns on button click event

    • @LlamAcademy
      @LlamAcademy  7 หลายเดือนก่อน

      Sure, perhaps the "Runtime Gun Swapping" video in this series will help you out: th-cam.com/video/Fpt9xA3Ftmo/w-d-xo.html

    • @maitrykotak3703
      @maitrykotak3703 7 หลายเดือนก่อน

      very very helpful thank u@@LlamAcademy

  • @dxlevou2145
    @dxlevou2145 ปีที่แล้ว

    Bro please tell which laptop best for developing games
    Because I have a low end device

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว +1

      I think you are probably looking for a "reasonable" laptop for developing games. "Best" is subjective and extremely expensive.
      I think the key hardware specifications to look for are 16gb RAM, a solid state drive of 500gb+ (probably 1TB is better), and a modern Ryzen 5 or Intel i5 or better. I generally like a more powerful video card, but that also pushes up the price quite dramatically. You can reasonably do with a modern (30XX / 40XX) for most games and be good to go. Personally I would go with the 3060 or 4060 or better, but the X050s are fine for lower quality or 2D games. I'm not familiar enough with the AMD mobility GPU side of things to say what an equivalent is there.
      Oh, and definitely a 1080p or better resolution! I'm shocked to see some laptops still have lower than FHD screens.
      With computers you can always spend more and always upgrade something. It's all about your budget and what you're trying to make.

    • @Tom-ll5qw
      @Tom-ll5qw ปีที่แล้ว

      id also recommend exploring non-unity game engines (godot is likely your best bet) if your hardware isnt the best

  • @Abdulwahab-vb6he
    @Abdulwahab-vb6he ปีที่แล้ว

    hey bro what do you do beside youtube channel?

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว +5

      Work out 💪
      Spend time with my family 🥰
      Work a full time job in enterprise software development 💰
      Try to make some games 🎮
      ...pretty much nothing else 😅

  • @thediamondleaf5111
    @thediamondleaf5111 5 หลายเดือนก่อน

    Please help
    I followed your exact steps but I keep getting this stupid error "Could not resolve 'PlayerArmature/Rig 1/Aim' because it is not a child Transform in the Animator hierarchy." And the hand doesn't move like in the video

    • @LlamAcademy
      @LlamAcademy  5 หลายเดือนก่อน

      This sounds like your initial configuration of the RigBuilder is not correct, or your root object does not have an Animator attached

  • @lillol3245
    @lillol3245 3 หลายเดือนก่อน

    Why your machine gun has hands and shoulders? I don't understand

  • @Glitch_404_0
    @Glitch_404_0 9 หลายเดือนก่อน +1

    What kind of computer is yours, please? ❤

    • @LlamAcademy
      @LlamAcademy  9 หลายเดือนก่อน

      I built it back in 2017 so kind of an old one now 😅

  • @kagisosetshwane169
    @kagisosetshwane169 ปีที่แล้ว +3

    i made an inventory system using your gun system. if you are interested i can share it with you anytime.

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว +2

      Cool! I would definitely love to see it!

    • @kagisosetshwane169
      @kagisosetshwane169 ปีที่แล้ว

      @@LlamAcademy Okay cool. I was looking for your email in order to share it and how it works. Where should i communicate with you in order to share the code?

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      you can send it to support@llama.software

  • @mohokhachai
    @mohokhachai 7 หลายเดือนก่อน

    Your model is too thin