PERFECT Weapon Aiming! (IK, Unity Tutorial Third Person Shooter)
💬 Let's learn how to make a character aim perfectly at a target.
🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
👍 Learn to make awesome games step-by-step from start to finish.
🎮 Get my Steam Games unitycodemonkey.com/gamebundle
🔴 RELATED VIDEOS 🔴
Awesome Third Person Shooter Controller! • Awesome Third Person S...
Make your Animations DYNAMIC with Animation Rigging! • Make your Animations D...
How to get Mouse Position in 3D and 2D! • How to get Mouse Posit...
💬 Let's learn how to make a character aim perfectly at a target.
This is essential for making a good shooter controller, without it the character will simply aim straight forward towards wherever your animation is aiming rather than aiming perfectly at the exact position in the world.
This is pretty easy to do thanks to the awesome Unity Animation Rigging package!
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and More!
✅ store.steampowered.com/app/12...
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🎮 Grab the Game Bundle at unitycodemonkey.com/gameBundl...
📝 Get the Code Monkey Utilities at unitycodemonkey.com/utils.php
#unitytutorial #unity3d #gamedev
--------------------------------------------------------------------
Hello and Welcome!
I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.
I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Other great Unity channels:
Unity - / unity3d
Brackeys - / brackeys
Dani - / @danidev
Jabrils - / @jabrils
BlackthornProd - / @blackthornprod
Sykoo - / sykootv
Jason Weimann - / @unity3dcollege
Jonas Tyroller - / @jonastyroller
--------------------------------------------------------------------
- Website: unitycodemonkey.com/
- Twitter: / unitycodemonkey
- Steam: store.steampowered.com/develo...
Пікірлер: 323
🌍 Get 95% OFF on Unity Mega Bundles assetstore.unity.com/?aid=1101l96nj&pubref=perfectweaponaim ✅ Get my Complete Courses! ✅ unitycodemonkey.com/courses 🔴 RELATED VIDEOS 🔴 Awesome Third Person Shooter Controller! kzread.info/dash/bejne/eJaBlqWkode1paQ.html Make your Animations DYNAMIC with Animation Rigging! kzread.info/dash/bejne/fnmru89_hJbedM4.html How to get Mouse Position in 3D and 2D! kzread.info/dash/bejne/Yp6Isq2zY8rHZNo.html
@NordicNjal
2 жыл бұрын
So what could the reasons be if it dont work at all?
@pudgystump
2 ай бұрын
Where did you get the standard animations you're using?
@user-qr5dw5pj2d
2 ай бұрын
@@NordicNjal I do not know the reason.I only know if there is only one rig in rig builder,there would not be an error.I only know the result.
Even as someone who works in Unreal, I can still learn so much from your videos! Unreal has like it's own way of achieving nearly the same thing in a very similar way so I can apply a lot of your tutorials to my own projects as well. Thank you!
@magnusm4
Жыл бұрын
Likewise I watched an Unreal tutorial on making Genji's dash. And I could easily copy the logic and just write it in C# form.
Thanks man, this is such a useful tutorial! And so on-point. I was having such a hard time getting the animation rigging package to work, since months. You my friend are a Godsend. Thank you so much for this!
Thats a underexplored theme IMO, took hours searching to get a procedural lever pulling animation to work. Thanks for bringing it. It was on point =)
I was just searching all youtube for this and I see a post notification on it from you, Thank you very much!
Your tutorials are so different bro! Always learn something new, even if I know some of it. Thanks
Wow Ive been doing my own game and this tutorial comes out and saves me ages! Thank you so much!
Thanks for this tutorial, Unity really has a lot of amazing functionality already built-in
Thank you, I've been looking for this forever!
You are a very gifted teacher. I've been teacNice tutorialng soft for over 50 years and really appreciate your video being a beginner in soft soft.
Very very nice. I played with animation rigging when it 1st came out and had very little success. This makes me want to try it again.
I finally decided i want to learn how to make games so I found your channel, loved it and watched the entire TOP10 games series plus some more and finding out you were Portuguese made me really proud for some reason. I love when channels I enjoy are from our little country. Congrats on the content.
@CodeMonkeyUnity
2 жыл бұрын
Thanks! Best of luck in your learning journey!
@franciscoalmeida6098
2 жыл бұрын
@@CodeMonkeyUnity thank you 😊
That two videos were insanely good
Perfect, I was looking for this
great tutorial like always code monkey. Took a bit of a break (1 1/2 ish years ) from unity (working in Unreal engine for a bit), also starting College at University of Nevada, Las Vegas (UNLV) [Getting my degree in Computer Science]!
awesome tutorial, thank you!
omg this is so hard but perfect job! thank you!
Thank you for such a useful tutorial
I love your every tutorials video 😍
I was doing this by code, and it was a pain because I had to stop animations. Excellent tutorial!, now refactoring to include this.
Another great video! I have been working with IK for a little bit now and I am not entirely opposed to the animation rigging workflow. However, I like to do as much as I can in code, I'd love to see a video on implementing this in code. Thanks again, truly appreciate all the knowledge you share.
@CodeMonkeyUnity
2 жыл бұрын
I'm not sure you can do much with Animation Rigging through code since the system compiles a bunch of things as soon as you hit play. For example you cannot dynamically swap the target game object or change the forward vector.
As of today I have bought all your courses 😊😊 keep sharing.. I like your tuts, they are really good and with lot of things to learn..
@CodeMonkeyUnity
2 жыл бұрын
Thanks! I really hope you like them! Feel free to post any questions in the Q&A section!
Thank you very much for your videos, I wanted to share that the constraint for the left hand is better set with Chain IK Constraint.
wow this is what i have been searching for, i m so graeful to be able to watch your video, thankyou so much
@CodeMonkeyUnity
4 ай бұрын
I'm glad it helped you!
Great videos they always help me
ty the best tutorial ever all is working
OMG YOU DID IT!! THANK YOU!!
This is really easy thanks !! Even we publish our assets on the asset store
Finally a well known developer youtuber made this.. been watching smaller youtubers tutorials and they out dated and were in a very low quality 😩
We need more of these tutorials CodeMonkey! 3D FPS Zombie Style 😎
hey bro please dont stop making videos like brackeys you are simply amazing
Nice video! Could you also make tutorial for this system with multiple weapons? I think it will be very good!
Awesome tutorial.
Thank you very much
If anyone has this error - "The TransformStreamHandle cannot be resolved" - change the Rig object parent from Player Armature (the main Parent) to "Root" so the object stays near the "Hips" object
@piotrgora5715
Жыл бұрын
Yes rig has to be in the same parent as the root -GameObject --root -head -etc --Rig --Cam
@amirhosseinmaali309
7 ай бұрын
Tnx Dud u r a hero
@24framedavinci13
5 ай бұрын
@@piotrgora5715 thanks GIGA CHAD
I hope you are making an extended (paid) tutorial series for a GTA 3rd person game using Synty assets. There are probably 10’sk Synty asset owners who would buy that - maybe 100’sk Synty asset owners- partner with Synty Studios (who might provide a basic pack to go with your course) and you would have a massive market.
Thank you for your work on this series of videos covering the different aspects of a third person shooter. I think what is missing from this series is how to handle strafing animations while aiming. Currently, the character's walking animations aren't realistic while aiming, with a sort of floating, moonwalking effect while aiming, the foot placement not consistent with the character's movement.
Thank you! Interesting)
Huh, 2 days ago. What a coincidence. I am not making any 3D game right now, but it came to my mind to just search for upper body IK so in case I want to do an fps boss fight in later, I know what I'm... aiming to work with. Thanks for this.
TNice tutorials is going in my helpful tutorials playlist.
going well. For so reason tNice tutorials video struck as really concise and really cleared up so questions I had. The DAW I used back in
Hey, i just completed both tutorials and i just got to say it, they were really useful, and everything ended up looking professional. Iused the mouse sphere and it didn't work right (when sudden changes in deepness, the spine IK turned too fast), but i created an gameobject 10 meters on the z axis of the main camera and it worked amazing. And I just lerped to create a smoother movement between the position and the positioni it should aquire when following the gameObject in font of the camera that i created. I am really happy and I hope you keed doing third person shooters. A cover mechanich and simple IA that also uses it and you just got a full game.
@CodeMonkeyUnity
11 күн бұрын
I'm glad the videos helped you! Smoothing can definitely help if you're going for a super fast twitch shooter
You know its a good day when Code monkey posts a video
thank you so much
I'm thinking about making all sorts of action games where this can come in handy😊🎉
tNice tutorials, good luck- you'll go far
You are doing god's work. Thanks. 3RD TPS Controller is hardest gameplay programming subject imho. I'm glad you made this.
U so good, thanks u bro
Great work!! Quick question, the code in this doesn’t line up with the code in the other video. I was wondering what video you have that goes through the shooting timing and such that lines up with the code used in this video? I have your coarse and looked through that but didn’t find the reference.
This would also probably be useful for character that uses binoculars or a rifle scope. Especially if that character needs to be seen by other characters.
I’ve been looking for this solution for years
I think you covered almost all of it your previous video on the topic, however I would rather see how you would implement the function of aiming through the scope in this set up, I am trying to achieve this but constantly facing different issues.
Great tutorial, thankyou. Issue I had is my guy holds his gun side on, applying a 45deg offset on the spines Y axis fixed that for me.
hi your videos are really helpful and help me a lot for my university assignment . However I'm still struggling on weapon pick up and changing weapon ,it would help a lot if you could do a videos on that ..... But even that you helped me sooo much . Thank you , Awesome content and easy to follow as well
@CodeMonkeyUnity
2 жыл бұрын
The basics would be just a simple weapon pickup with a trigger collider to see when the player touches it kzread.info/dash/bejne/dJdtzs-BmtSyisY.html Beyond that it really depends on how you implement it, you would need some script to manage switching weapons and keeping track of the active one. Then also change the visual which would possibly also require changing the IK rig (rifle requires two hands, pistol just one)
Hey CodeMonkey, first of all great video! I'd love to learn more about the 2D bones, rigging (skinning) using built-in editor (when using PSB format). Most of the videos usually explain the 3D way which is slightly different and your videos are always in-depth with awesome examples so do you have any existing ones here or in any of your courses? I already bought the ultimate course but I'm having hard times finding this exact thing 😅
@CodeMonkeyUnity
Жыл бұрын
Yeah rigging a character in 2D is a completely different tool docs.unity3d.com/Packages/com.unity.2d.animation@9.0/manual/CharacterRig.html It's something I've had on my list for a long time but haven't covered it yet, haven't done much 2D specific things in a long time
Están muy buenos los gráficos. Lo digo enserio. No sé porque no hacen más juegos así. Podrían meter más cosas si dejan modelos de bajos polígonos.
Sir Plz do a tutorial on Sword and Mele Combat...Thanks
Could you please also make tutorials for a First Person Shooter? That would be great!
@CodeMonkeyUnity
2 жыл бұрын
Yup that's a topic I'd like to cover some more, I've only made one or two FPS tutorials so far
@eliaspiersig9994
2 жыл бұрын
@@CodeMonkeyUnity that sounds amazing! I’m looking forward to it.
thanks
Great work I want to make something more like risk of rain 2 where the character can always shoot in third person mode with out aiming for you have a tutorial on that?
Please make one tutorial on full body fps.. Using Animation rigging package, how head stablize with mouse movement
Thank´s ;)
Could you maybe make a little Tutorial on adding Google account to a Game for e.g. saving Highscores, or even better, a semi-multiplayer high score where the game itself is singleplayer, but the high score of all players could be seen, maybe with firebase? as always, keep up your good work.
it work on my pc thx bro vеry much
i have a little question, isn't related with the video, but how could it be the best way to make a parabolic movement which is mathematically accurate, im doing some simulations and tried with rigidbodies but the results weren't the expected ones
What if you want to pick up the weapons though. I started working on something like that, but with hand placement. It didnt worked well. This video makes me wanna go back to it
Hello code monkey i have one question. How camera shake beautifully can you make the video on this topic. Thanks
Can we all please get the full ThirdPersonShooter code from this video, because a lot of the code is now changed from the previous tutorial
If I were to be using a weapon system where I switch between a Handgun and a riffle, how could I setup the IK for each and then use
I wanna do the same with the gamepad rightstick but seems buggy, can you do a tutorial for similar scenario but with a Gamepad??
so is the raycast script on the Target Transform your putting in the animation rig towards the end? I am using this on the end result of your video on the third person shooter. Excellent stuff, I have learned many things from you.
@CodeMonkeyUnity
2 жыл бұрын
Yes the transform that is moved to the mouse position is what is used as the target for the rig
There is only one rig in rig builder's rig layers?I put two rig in rig layers,there are two player's animation states, then there was an error : System.InvalidOperationException: The TransformStreamHandle cannot be resolved.This Exception was thrown from a job compiled with Burst, which has limited exception support.
Where did you get these awesome character locomotion animations?
How did you do the cinemachine impulse please when shooting ?
Great stuff, was waiting for you to make this tutorial. How can I change weapon hand placement by code for different weapons? It is a bit tedious to do everything by hand. Also where did you get the shooting particles? They look awesome!
@CodeMonkeyUnity
2 жыл бұрын
You would just need to store the position and rotation of the IK targets, perhaps on the same SCriptable Object that you define the weapon stats. Then when changing weapon, change the weapon mesh and reposition those targets. I made the particles, its just a simple TrailRenderer with a bunch of glow and some exploding particles at the end, they're quite simple, the visuals are all about the post processing
@lime_68
2 жыл бұрын
@@CodeMonkeyUnity Thank you very much. this topic is not covered much nowadays. Do you know which other topic got me frustrated? Ledge climbing(like climbing on the wall, or jumping over object like in GTA /Assasin's creed for instance)this topic is not covered on youtube well. All tutorials that I find about this topic are bad. I believe you can fill the void
Can you maybe upload this project? I can't have the animation rigging set up nicely... it is so broken for me and I can't find any solution, having access to this will help me so much
Are you using freelook camera for tps view?
Don't forget to attach the Rig to the aimRig in the inspector.
Hello i am doing the exact same steps as the video but it keeps giving me erorrs saying this: Could not resolve 'Player/Rig 1/BodyAim' because it is not a child Transform in the Animator hierarchy. i would really appreciate some help thanks
Yet to watch the video, but the thumbnail of this video and title are way better than your usual go to. The only thing I can suggest is to increase the contrast of the thumbnail and use colors that are like candy to our eyes. Bright but not generic colors, colors like cherry red/lime/hot pink/azure. Also maybe give complimenting colors a try :D
is this project uploaded anywhere ? The code is different from previosu tutorial.
Loved the tutorial! how do you get the projectile/bullet to look like that exactly? trying to make it in my game so that it looks like theres "tracer" fire from projectiles :)
@CodeMonkeyUnity
2 жыл бұрын
The visual is mainly just a TrailRenderer with some nice glow kzread.info/dash/bejne/lJ-Ex5OhqLLTkqw.html For the movement, the character does a raycast to find where the bullet will hit, then spawns the bullet object on the shoot position and that object (which has the trail) simply moves towards the target and destroys itself. No physics used in the bullet itself
@xianchaencari3244
2 жыл бұрын
@@CodeMonkeyUnity Ohhhh!!! thank you so much! slowly getting there c: your videos are a big help!
This was a quite good tutorial! Thanks for this :) Furthermore i have one question you may have done a tutorial to: In some first person games (such as muck for instance) the object held by the player moves (or is animated) in a very natural way and when you change your direction (ver and hor) the object moves with a slight delay which makes the movement very nice. Have you done a tutorial on how to do this or do you have a keyword for this?
@CodeMonkeyUnity
7 ай бұрын
That's pretty much the same thing as in this video, using Animation Rigging IK, and then you apply that delay in the code. Basically have some logic that smoothly interpolates the transform that the weapons is pointing at slowly behind the camera movement.
@PatrickEn
7 ай бұрын
@@CodeMonkeyUnity Since my character only uses one arm to hold a weapon i am not sure which constraint to use? I tried two bone ik constraint and it kinda works but not really good. It looks like i have 10 fps :D Or should i use the one you used in the video? The delay works tho :)
Hello! I just bought one of your course today I haven't started yet but I'm wondering if the third person controller and the aim system could be use in a topdown game
@CodeMonkeyUnity
2 жыл бұрын
Yup! And since in top down you don't really care about the Y axis then you could stick with the simplified third person controller which would be even easier
Can you please make a video teaching us how we can make wall running for third person
If anyone else runs into the " Cannot resolve because it is not a child of the etc etc." Move your Rig 1 onto the character. If you are following along with Synty Assets, I put it under the Root (not in the Root, under) Hope that helps someone else, this was an annoying issue.
@fred_proenca
2 жыл бұрын
Omg!!! I had the same issue! Thank you so much! It was so annoying 😅
@tomiwaogundimu3316
Жыл бұрын
Thank You so much for this info ....been battling with This since
@joew5833
Жыл бұрын
you're a lifesaver, thank you
@jtlewis81
6 ай бұрын
Yeah, I just ran into this and came to the comments looing for help. thank you! As much as I love synty assets, the characters do not usually play nice with animation stuff.
Amazing! 🙏 Just one thing. Would it be too much to ask you to change your VS theme to dark mode? Unity is fine-(ish) but the VS editor is SO WHITE the photons destroy ones eyes 👀
@CodeMonkeyUnity
2 жыл бұрын
Sorry I cant, dark mode burns my eyes
But how do you know that the hand points exactly where the tip of the gun points?
Can you create a package from this project? with no-copyright humanoid models
Hi code monkey. Your tutorial are awesome. I also took your one course in use my and it is good. I just want to know how did you make those live chat bubble peoples roaming in your live stream? I am unable to find if you have done any video on that.
@CodeMonkeyUnity
2 жыл бұрын
I made a video here kzread.info/dash/bejne/fWVnudCHfJS1ibA.html The main thing is really just sizing the background to fit the text Similar to how the tooltip works kzread.info/dash/bejne/i4l90cp8iNfFoMY.html And then the Text Writer is also pretty easy kzread.info/dash/bejne/jIqcltCBaLDHqco.html
when i need something you got it :D
@CodeMonkeyUnity
Жыл бұрын
Heh that's great, I'm glad you find the videos helpful!
Sir could you please make a tutorial based on auto aiming like in multiplayer games like pubg ,free fire
3:54 what if my downloaded rig have wrong direction? hand look at not to Z, but z+y (under 45 deg)
Hi, Code Monkey👋 I have an idea that you can try to start making some devlogs, because most of the gamedevs do that and I found it interesting. I hope you'll read my suggestion. Thanks for tutorials💪
@CodeMonkeyUnity
2 жыл бұрын
Yup whenever I start working on my next Steam game I'll definitely be doing some devlogs
Do you think you can make an Ik tutorial on how to walk up stairs
I want to learn to make my character shoot like yours. How do we do that? I've followed all videos related to 3rd person shooters but there isn't one with how you put the audio, the shooter effect such muzzle and the projectile
@CodeMonkeyUnity
6 ай бұрын
I covered the projectile in the Third Person shooter video unitycodemonkey.com/video.php?v=FbM4CkqtOuA The particles, you spawn them on the same place as the bullet The audio, you just spawn an audio clip unitycodemonkey.com/video.php?v=QL29aTa7J5Q
Could not resolve 'PlayerArmature/Rig 1/AimObj' because it is not a child Transform in the Animator hierarchy.
i have fps hand anim how to combine it with humanoid character
Hey first of all I would like to say thanks a lot for these awesome videos they are teaching me so much. I am stuck on a problem at 11:10 My character is doing that crazy morph thing because he is still stuck in the animation rigging state at idle. I tried to fix it with the steps you showed in this video. But I couldn't because the code is more updated from your "Awesome Third Person Shooter Controller" Video So I could implement the rig weight dynamics in the script. Is there any way to get the more updated script? Thanks again!
@CodeMonkeyUnity
2 жыл бұрын
What can't you do? You just need to set the rig weight to 0 or 1. I didn't make a package for this one since it's very much based on animations which I cannot distribute. I don't remember what I changed from the other script but as long as you know when you are in aim state then you should be able to add that logic
@Samael-lp3nk
2 жыл бұрын
@@CodeMonkeyUnity Thanks I can figure it out with this information! 👍
Where you get the rifle animation like rifle walk and rifle run and the rifle idle ?
@CodeMonkeyUnity
Жыл бұрын
One good place to get free animations is mixamo unitycodemonkey.com/video.php?v=c4jtyDA7vcs