PERFECT Weapon Aiming! (IK, Unity Tutorial Third Person Shooter)
HTML-код
- Опубликовано: 25 янв 2022
- 💬 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...
🌍 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! ruclips.net/video/FbM4CkqtOuA/видео.html
Make your Animations DYNAMIC with Animation Rigging! ruclips.net/video/LEwYmFT3xDk/видео.html
How to get Mouse Position in 3D and 2D! ruclips.net/video/0jTPKz3ga4w/видео.html
So what could the reasons be if it dont work at all?
Where did you get the standard animations you're using?
@@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!
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.
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 =)
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!
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.
Wow Ive been doing my own game and this tutorial comes out and saves me ages! Thank you so much!
Thank you, I've been looking for this forever!
Thanks for this tutorial, Unity really has a lot of amazing functionality already built-in
Your tutorials are so different bro! Always learn something new, even if I know some of it. Thanks
I was just searching all youtube for this and I see a post notification on it from you, Thank you very much!
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.
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]!
Perfect, I was looking for this
That two videos were insanely good
I love your every tutorials video 😍
Finally a well known developer youtuber made this.. been watching smaller youtubers tutorials and they out dated and were in a very low quality 😩
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..
Thanks! I really hope you like them! Feel free to post any questions in the Q&A section!
awesome tutorial, thank you!
omg this is so hard but perfect job! thank you!
I was doing this by code, and it was a pain because I had to stop animations. Excellent tutorial!, now refactoring to include this.
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.
Thanks! Best of luck in your learning journey!
@@CodeMonkeyUnity thank you 😊
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.
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.
Thank you for such a useful tutorial
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.
We need more of these tutorials CodeMonkey! 3D FPS Zombie Style 😎
wow this is what i have been searching for, i m so graeful to be able to watch your video, thankyou so much
I'm glad it helped you!
OMG YOU DID IT!! THANK YOU!!
Great videos they always help me
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.
hey bro please dont stop making videos like brackeys you are simply amazing
This is really easy thanks !! Even we publish our assets on the asset store
ty the best tutorial ever
all is working
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.
Nice video! Could you also make tutorial for this system with multiple weapons? I think it will be very good!
Awesome tutorial.
Thank you! Interesting)
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.
You know its a good day when Code monkey posts a video
TNice tutorials is going in my helpful tutorials playlist.
Thank you very much
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
I'm thinking about making all sorts of action games where this can come in handy😊🎉
tNice tutorials, good luck- you'll go far
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.
I'm glad the videos helped you! Smoothing can definitely help if you're going for a super fast twitch shooter
thank you so much
I’ve been looking for this solution for years
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
The basics would be just a simple weapon pickup with a trigger collider to see when the player touches it ruclips.net/video/Bc9lmHjqLZc/видео.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)
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
Yes rig has to be in the same parent as the root
-GameObject
--root
-head
-etc
--Rig
--Cam
Tnx Dud u r a hero
@@piotrgora5715 thanks GIGA CHAD
You are doing god's work. Thanks. 3RD TPS Controller is hardest gameplay programming subject imho. I'm glad you made this.
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 😅
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
Could you please also make tutorials for a First Person Shooter? That would be great!
Yup that's a topic I'd like to cover some more, I've only made one or two FPS tutorials so far
@@CodeMonkeyUnity that sounds amazing! I’m looking forward to it.
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.
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.
U so good, thanks u bro
Thank´s ;)
thanks
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.
Sir Plz do a tutorial on Sword and Mele Combat...Thanks
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.
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
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.
it work on my pc thx bro vеry much
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.
Please make one tutorial on full body fps.. Using Animation rigging package, how head stablize with mouse movement
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?
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.
Yes the transform that is moved to the mouse position is what is used as the target for the rig
when i need something you got it :D
Heh that's great, I'm glad you find the videos helpful!
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!
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
@@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
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
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
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?
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.
@@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 code monkey i have one question. How camera shake beautifully can you make the video on this topic.
Thanks
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 :)
The visual is mainly just a TrailRenderer with some nice glow ruclips.net/video/bkPe1hxOmbI/видео.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
@@CodeMonkeyUnity Ohhhh!!! thank you so much! slowly getting there c: your videos are a big help!
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
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💪
Yup whenever I start working on my next Steam game I'll definitely be doing some devlogs
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 👀
Sorry I cant, dark mode burns my eyes
Sir could you please make a tutorial based on auto aiming like in multiplayer games like pubg ,free fire
Where did you get these awesome character locomotion animations?
Can you please make a video teaching us how we can make wall running for third person
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.
I made a video here ruclips.net/video/K13WnNL1OYM/видео.html
The main thing is really just sizing the background to fit the text
Similar to how the tooltip works ruclips.net/video/YUIohCXt_pc/видео.html
And then the Text Writer is also pretty easy ruclips.net/video/ZVh4nH8Mayg/видео.html
I wanna do the same with the gamepad rightstick but seems buggy, can you do a tutorial for similar scenario but with a Gamepad??
hey there! was wondering if you'd be able to make a tutorial on how to make a realistic HDRP enviroment with a forest and a path? :)
Check out the channel Sykoo, he does a bunch of level design timelapses
@@CodeMonkeyUnity sure thing 👍 though if possible I'd be in need of detailed videos explaining some stuff I've been having trouble implementing instead. such as grass or realtime snow deformation without losing performance etc. Good video as always by the way.
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
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
How did you do the cinemachine impulse please when shooting ?
Good
Are you using freelook camera for tps view?
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!
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
@@CodeMonkeyUnity Thanks I can figure it out with this information! 👍
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
Do you think you can make an Ik tutorial on how to walk up stairs
Don't forget to attach the Rig to the aimRig in the inspector.
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
I was also exactly having the sa expressions LMFAO
is this project uploaded anywhere ? The code is different from previosu tutorial.
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
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
Can you create a package from this project? with no-copyright humanoid models
could you do a video on a third person camera using cinemachine
The basis for this character is from the free starter assets, you can look at that to see how the camera works ruclips.net/video/jXz5b_9z0Bc/видео.html
But how do you know that the hand points exactly where the tip of the gun points?
Where you get the rifle animation like rifle walk and rifle run and the rifle idle ?
One good place to get free animations is mixamo unitycodemonkey.com/video.php?v=c4jtyDA7vcs
Hey do you have a link to the new code you added to the thirdperson shooter controller? Its alot different from the first video with new methods 11:41
I just refactored it to match my coding style. I don't remember if the downloadable project files for the third person shooter already have that refactor, if not then the Ladder video should have it unitycodemonkey.com/video.php?v=44qVzrdvm04
@@CodeMonkeyUnity thanks
please make video on unity multiplayer