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

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 KZread Member:
⚫ Patreon: / llamacademy
⚫ KZread Member: / @llamacademy or click the Join button on any video
📱 Let's stay connected
KZread: / 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

Пікірлер: 45

  • @SB-jx6ox
    @SB-jx6ox10 ай бұрын

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

  • @LlamAcademy

    @LlamAcademy

    10 ай бұрын

    You're very welcome!

  • @arthurjvnb
    @arthurjvnb10 ай бұрын

    Finally some good IK material to learn from! :D

  • @RST-XIII
    @RST-XIII9 ай бұрын

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

  • @Hasoon-ry8pu
    @Hasoon-ry8pu10 ай бұрын

    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

  • @shadowartz9968
    @shadowartz996810 ай бұрын

    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

    10 ай бұрын

    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.

  • @Amiranx
    @Amiranx10 ай бұрын

    Best channel in the world

  • @alsadeeroffice314
    @alsadeeroffice31410 ай бұрын

    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

  • @Jzrz369
    @Jzrz3695 ай бұрын

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

  • @helloyou191
    @helloyou19110 ай бұрын

    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

    10 ай бұрын

    I do not have one specifically for refunds, but I do have a pretty in-depth Unity IAP video: kzread.info/dash/bejne/iGFrtJaCmLaddZs.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

    10 ай бұрын

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

    10 ай бұрын

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

    10 ай бұрын

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

  • @Tom-ll5qw
    @Tom-ll5qw10 ай бұрын

    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

    10 ай бұрын

    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

    10 ай бұрын

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

    10 ай бұрын

    @Tom-ll5qw I did cover a save/load system while ago kzread.info/dash/bejne/n6KotZZul5u1e5c.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

    10 ай бұрын

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

    10 ай бұрын

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

  • @user-qr5dw5pj2d
    @user-qr5dw5pj2dАй бұрын

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

  • @RevelationRealm001
    @RevelationRealm00110 ай бұрын

    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

  • @miransheix3351
    @miransheix335110 ай бұрын

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

  • @LlamAcademy

    @LlamAcademy

    10 ай бұрын

    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

  • @dxlevou2145
    @dxlevou214510 ай бұрын

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

  • @LlamAcademy

    @LlamAcademy

    10 ай бұрын

    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

    10 ай бұрын

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

  • @brodakarat6340
    @brodakarat63404 ай бұрын

    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

    3 ай бұрын

    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
    @maitrykotak37035 ай бұрын

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

  • @LlamAcademy

    @LlamAcademy

    5 ай бұрын

    Sure, perhaps the "Runtime Gun Swapping" video in this series will help you out: kzread.info/dash/bejne/eKSom9p6Y6nandI.html

  • @maitrykotak3703

    @maitrykotak3703

    5 ай бұрын

    very very helpful thank u@@LlamAcademy

  • @thediamondleaf5111
    @thediamondleaf51112 ай бұрын

    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

    2 ай бұрын

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

  • @lillol3245
    @lillol3245Ай бұрын

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

  • @Abdulwahab-vb6he
    @Abdulwahab-vb6he10 ай бұрын

    hey bro what do you do beside youtube channel?

  • @LlamAcademy

    @LlamAcademy

    10 ай бұрын

    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 😅

  • @Glitch_404_0
    @Glitch_404_07 ай бұрын

    What kind of computer is yours, please? ❤

  • @LlamAcademy

    @LlamAcademy

    7 ай бұрын

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

  • @kagisosetshwane169
    @kagisosetshwane16910 ай бұрын

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

  • @LlamAcademy

    @LlamAcademy

    10 ай бұрын

    Cool! I would definitely love to see it!

  • @kagisosetshwane169

    @kagisosetshwane169

    10 ай бұрын

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

    10 ай бұрын

    you can send it to support@llama.software

  • @mohokhachai
    @mohokhachai4 ай бұрын

    Your model is too thin

Келесі