[#02] THIRD PERSON SHOOTER: Character Strafe Locomotion (Blend Trees + Cinemachine)

  Рет қаралды 95,769

TheKiwiCoder

TheKiwiCoder

Күн бұрын

Пікірлер: 303
@ethanwebb2035
@ethanwebb2035 4 жыл бұрын
YOU ARE MY SAVOUR!!!, I have spent literally 3 hours watching videos trying to figure out why my character kept rotating in a circle when I strafe left and right, and no one has mentioned the world space button except you, thank you so much. 3 hours just to figure out I needed to press one button lol :)
@Darkknife01
@Darkknife01 4 жыл бұрын
I found several youtubers who when creating third person movement or controllers went over world space. Brackeys, Samyam etc. Maybe not when going over animation however
@ДиманЧоус
@ДиманЧоус 2 жыл бұрын
Bro this channel is such a treasure. Thanks man! The best tutorials on the internet
@cozziee92
@cozziee92 3 жыл бұрын
I am just starting my unity journey after years of mobile app development and your videos have been a blessing. Please don't stop, ever. God bless you.
@killervoid6352
@killervoid6352 4 жыл бұрын
this is the only third person shooter tutorial that goes into the animator, fantastic work you earned my sub lol.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Thank you!
@wilwatts6298
@wilwatts6298 2 жыл бұрын
Thanks a lot I've watched too many videos on this subject and they NEVER mention that you have to write a script to control the animations. Keep up the good work and continue include all of the details when teaching others.
@Владислав-б6г1г
@Владислав-б6г1г 4 жыл бұрын
2 недели искал подобную реализацию движения персонажа, и вот наконец то наткнулся на твой гайд! Ты лучший!!! Hi from Russia! ;)
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Thank you! Good luck :)
@TwistedSisler
@TwistedSisler 4 жыл бұрын
Just some input. I've found that using a Character Controller feels better than using a rigidbody and collider. You don't get caught on the environment and it feels way smoother. You just have to script your own gravity, but that is really easy to do.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
My later video converts from a rigid body to a CC, I agree it can be a lot smoother.
@barkmober
@barkmober 2 жыл бұрын
@@TheKiwiCoder would it be possible for you to provide the source code?
@naishtech8132
@naishtech8132 2 жыл бұрын
2:18 - Camera Setup 2:48 - Character Physics 3:14 - Animation Controller 7:06 - Character Locomotion Script 8:26 - Character Rotation Script 11:17 - Fine Tuning
@frosty7652
@frosty7652 2 жыл бұрын
ty
@upsurge5541
@upsurge5541 3 жыл бұрын
Man i've been trying to make my player look at the camera for 5 days now everytime i did it it caused the player to stutter alot u just fixed it for me THANK YOU BROTHER
@NowWeWake
@NowWeWake 4 жыл бұрын
Hi KiwiCoder! Really enjoying this tutorial series. Thank you so much for making it. Quick note: If you don't set the X-damping to 0 in Cinemachine (which you do), the character will always strafe at a slight angle. The damping causes the camera to lag behind the player, then rotate to follow it slightly, which causes the player to turn slightly; hence the angled strafing. Man, this took me ages ;)
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Ah thanks for finding that. I’ve yet to try out the 3rd person aim component as it wasn’t available when I created this video. Check here for more details:blogs.unity3d.com/2020/05/22/cinemachine-2-6-brings-you-precision-improved-workflow-and-little-bits-of-magic/
@davidribeiro4781
@davidribeiro4781 4 жыл бұрын
Keep going. Great work with this. Excellent sense of what questions arise along the way and direct and educational instructions.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Thank you 🙏 More videos on their way ✌️
@timithius7885
@timithius7885 11 ай бұрын
Exactly what I'm looking for, and Synty even! Thanks fellow Kiwi!
@Bryan-bh7cy
@Bryan-bh7cy 3 жыл бұрын
dude your series is a gem
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Thank you for watching!
@WizBricks
@WizBricks 4 жыл бұрын
Thank you for this video! I've been looking for something like this on and off forever. Nobody had an answer on how to this with cinemachine.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
I was in the same boat! That's what lead me to create this video
@thecreativity5793
@thecreativity5793 4 жыл бұрын
Closing inspector tab for lag just saved me !
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
It's one of those gotchas of using Unity. I've found collapsing components in the inspectore will also improve performance, and only expand the component you're working on. Also collapsing sections within a component can help.
@neenaw
@neenaw 3 жыл бұрын
I too was trying to create strafing using mixamo animations. The issue is their backwards strafe animations don't blend with sideways strafing. I got to that point and remembered this exact video.
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Nice!
@xaviergordon1343
@xaviergordon1343 4 жыл бұрын
Really In depth brilliant tutorial
@aryangovil265
@aryangovil265 4 жыл бұрын
If anyone's character is stationary in position try changing, the rig to humanoid and ticking the green buttons present in the animation tab (note the green buttons will only be displayed when rig is changed) hope this helps someone
@aryangovil265
@aryangovil265 4 жыл бұрын
Thnx
@remcrap1139
@remcrap1139 4 жыл бұрын
How i dont see anything unity 2020
@aryangovil265
@aryangovil265 4 жыл бұрын
@@remcrap1139As this is a fix for 2019 version
@remcrap1139
@remcrap1139 4 жыл бұрын
@@aryangovil265 no bother i didnt attach the scripts
@juanp4446
@juanp4446 2 жыл бұрын
just fantastic, seriously these tutorials give me life bro :D
@siddharth617
@siddharth617 3 жыл бұрын
Really Enjoy your Tutorials! I've been struggling to grasp the concept of third-person systems...you just made them as simple as you make it sound! Great Work bro! Keep it up! : )
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Thank you!
@DaveEsimen
@DaveEsimen 4 жыл бұрын
Amazing tutorial. So much content in such fast video. Liked and subbed. I'm gonna watch all your videos.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Thanks very much!
@game__me__me8795
@game__me__me8795 4 жыл бұрын
Your tutorials are great. Please make more videos about third person shooters.
@jaehoopark8106
@jaehoopark8106 4 жыл бұрын
You're amazing. This is exactly what I like to learn. Please more tutorials about TPS.
@raiskhan20
@raiskhan20 4 жыл бұрын
Liked, subscribed and also added to my library list😁
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Cheers!
@marcodoesitbetter8675
@marcodoesitbetter8675 4 жыл бұрын
WoW! amazing video ! Keep it coming bro ! :D
@adeveloper7184
@adeveloper7184 4 жыл бұрын
Cool! Previous shooting video has gun, i though this one gonna be about shooting machnim with all the IK and all ;) well hope those video gonna come out soon,
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
That will be coming soon! I really wanted to get this out first though, and then build the aiming system on top of this character controller.
@adeveloper7184
@adeveloper7184 4 жыл бұрын
@@TheKiwiCoder well! Coding third person shooter with all the functionality can be really painful, although there are so many visual scripting tools, but your tutorial on this is by far the unique and the easiest. Hope you cover all, like a complete game. We can wait ;) no issue. But don't make us wait like other KZbinrs do :( best of luck with the youtube channel man! Hope to see the awesome running animations too
@thecreativity5793
@thecreativity5793 4 жыл бұрын
This would be great!
@billy_avila
@billy_avila 4 жыл бұрын
If your Character isn't moving properly, make sure you've deleted the movement script from the previous video. The only script that should be on your character by about the 8 minute mark is Character Locomotion.
@aldifahluzi6998
@aldifahluzi6998 3 жыл бұрын
my character still doesnt move, i dont understand why:(
@aleqkzander
@aleqkzander Жыл бұрын
Good job - tutorial brought to the point :)
@greendino5868
@greendino5868 2 жыл бұрын
my character keep returning/resetting position when backward
@MystMagie
@MystMagie 3 жыл бұрын
How would you approach it if you wanted to have : - Free camera moving around the player when player is Idle - Player moving in direction of the Camera when player is waking/running. When player press right or left, character goes right or left (not strafing) - Strafe movement and zoom when aiming (right click) Basically thats the standard type of moment for any Third person game, like Uncharted, Assasin s Creed etc However i cant find any tutorial about it
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Create a transition from this blend tree to a 1dimensional blend tree for the not aiming state (checkout my ai series for that blend tree). Rotate the character with the keyboard input instead of the mouse when in the not aiming state. Idle is the same as the not aiming state (I think)
@ohalohuntero
@ohalohuntero 4 жыл бұрын
Awesome stuff dude thanks for the video!
@cengizgorencom4251
@cengizgorencom4251 4 жыл бұрын
YOURE THE BEST !!! I LOVE YOU
@dumitrudragomir5703
@dumitrudragomir5703 3 жыл бұрын
Hi, if you re too lazy to write here is the script for CharacterAiming using System.Collections; using System.Collections.Generic; using UnityEngine; public class CharacterAiming : MonoBehaviour { public float turnSpeed = 15; Camera mainCamera; // Start is called before the first frame update void Start() { mainCamera = Camera.main; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } // Update is called once per frame void FixedUpdate() { float yawCamera = mainCamera.transform.rotation.eulerAngles.y; transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(0, yawCamera, 0), turnSpeed * Time.fixedDeltaTime); } }
@amanvahora495
@amanvahora495 3 жыл бұрын
5HABJ YOUUU
@keagancarson6371
@keagancarson6371 3 жыл бұрын
I guess I am pretty randomly asking but does anybody know of a good site to stream newly released tv shows online?
@marcusbeckham3744
@marcusbeckham3744 3 жыл бұрын
@Keagan Carson lately I have been using flixzone. You can find it on google :)
@aressantino2382
@aressantino2382 3 жыл бұрын
@Marcus Beckham Yup, been using FlixZone for since april myself :D
@keagancarson6371
@keagancarson6371 3 жыл бұрын
@Marcus Beckham thanks, signed up and it seems like they got a lot of movies there :) Appreciate it!
@BRIANROSER
@BRIANROSER 25 күн бұрын
My "aim up" stops at the center. There must be something I did wrong but I followed every step. The Y axis movement just stops at a certain point while Im still aiming towards the ground. When I move it completey down the camera is above the player and points downwards....
@thelostgrimm
@thelostgrimm 2 жыл бұрын
Awesome Video man. I'm having an issue though. I'm very new to this. everything is all set except my character won't walk. not sure how to set WASD for walking.
@kurviern
@kurviern 2 жыл бұрын
Hi, have you solved your problem?I can not
@thelostgrimm
@thelostgrimm 2 жыл бұрын
@@kurviern no man, sorry. i remember this video is kinda old and an older version of Unity. I didn't know where to look. Sadly no one felt like helping
@juansalvatore7450
@juansalvatore7450 2 жыл бұрын
For it to work in the current Unity version (2021.3.0f1) I had to declare the method FixedUpdate instead of camel case (fixedUpdate) like in the video
@hadieini
@hadieini 4 жыл бұрын
Super COOL!
@nobody971
@nobody971 4 жыл бұрын
Hey! Great tutorials. Though, I followed this very slowly and somehow got an error for the CharacterAiming script. It said the "float yawCamera = mainCamera.transform.rotation.eulerAngles.y; " line had an issue. The script is assigned to my character model btw! Here is the error: NullReferenceException: Object reference not set to an instance of an object CharacterAiming.FixedUpdate () (at Assets/Scripts/CharacterAiming.cs:20) Thanks for the series of tutorials, it helps a lot with learning animation in Unity!
@nobody971
@nobody971 4 жыл бұрын
I fixed the issue... I am not entirely sure of the issue itself, and why in the video it worked (and not for myself). My theory is the update I may have been using might've rejected the code. Anyways, in the start(), DONT repeat mainCamera = Camera.main... There is no point. It essentially detached the camera, so it's counterproductive. My CharacterAiming script! ALSO, I have made the camera public, so don't forget to link in the inspector... hatebin.com/gndzdljapq
@Bob-king04
@Bob-king04 4 жыл бұрын
@@nobody971 HEY MEN I HAVE SAME ISSUE ... AND MY PLAYER MOVE IN PLACE . YOU HAVE IDIA HOW TO FIX ?
@adamgiuffrida3972
@adamgiuffrida3972 3 жыл бұрын
@Christian Alp dude I was losing my mind thank the lord he had the answer lmao
@markegan2570
@markegan2570 2 жыл бұрын
@@nobody971 Thanx! Works
@phantom5229
@phantom5229 Жыл бұрын
@@nobody971 👍
@kieranraquel2949
@kieranraquel2949 4 жыл бұрын
Hey! TheKiwiCoder, I followed your tutorial but I am stuck where the character stays in place when I put in the character_aim script and doesn't move anywhere, any ideas? Btw, Great Tutorial.
@marantino1
@marantino1 4 жыл бұрын
In the inspector of the character (SM_Character_Male_01) in the Animator component turn Apply Root Motion toggle on. That fixed it for me.
@muhammadumairmumtaz6993
@muhammadumairmumtaz6993 4 жыл бұрын
i have a question , when i use this for mobile and i have button which i press the camera starts rotating towards button direction.kindly help me.
@elsyndur4415
@elsyndur4415 4 жыл бұрын
How do I upgrade Cinemachine? My version of it doesn't have the Camera Offset extension, and it's no longer available on the asset store.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Use package manager to upgrade. Everything has moved from the asset store there.
@elsyndur4415
@elsyndur4415 4 жыл бұрын
@@TheKiwiCoder Ah. Found it. Thank you.
@nikshepamin8570
@nikshepamin8570 4 жыл бұрын
Really Cool Tutorial. I Want My Character To Run When I Hold Shift Button Please Make A Tutorial On It. It Will Be Much Helpful For Lot Of Developers. :)
@dumbguy1073
@dumbguy1073 4 жыл бұрын
he already said that in 1st tutorial
@SHOST01
@SHOST01 4 жыл бұрын
When you strafe from left to right quickly the character will snap to the next animation. Is there any way to make this transition smoother?
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Good point. I think what is happening is the input is snapping from left to right as the direction is changed.
@SHOST01
@SHOST01 4 жыл бұрын
Do you know of any way to make it smoothly go into the next animation when the direction is changed instead of snapping to it?
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
This page has some more details: answers.unity.com/questions/341962/smooth-transition-for-getaxis-when-pressing-opposi.html
@SHOST01
@SHOST01 4 жыл бұрын
@@TheKiwiCoder You. Are. AWESOME! This helped fix it. I have been looking everywhere for some way to fix this. Thank you!
@raveheart58
@raveheart58 4 жыл бұрын
Jade Clayton 🙌
@reinhardgercken5362
@reinhardgercken5362 3 жыл бұрын
Hi, verry helpfull video! I have all your infos (verstanden in german). I will look to your other videos (great work!)
@itsWorm
@itsWorm Жыл бұрын
How do we get the feet to move in when the player turns in place?
@foncode101
@foncode101 11 ай бұрын
my reticle is off when i move to the left due to the animation. cant figure it out but trying..
@fred1541
@fred1541 10 ай бұрын
I am always confused by the situation when a 3d player can't rotate, but he can walk right or left or forward, back, facing to the enemy, what this term will be? I just find the correct term from your title, strafe motion in blend tree, thanks
@Zukomazi
@Zukomazi 4 жыл бұрын
All the animations from the GitHub have import warnings and dont work?? any tips cant even follow the tutorial now. And I was enjoying it :C
@dkordy
@dkordy 3 жыл бұрын
Perfect, thank you very much. Very practical presentation. The music in the background makes the whole exhibition much more pleasant. I am very grateful to you. Essential, enjoyable exposure.The only complaint I have is - when you write a script, the letters are too small and when I expand the screen to full screen it is still very small ... somehow to enlarge while writing the code!? Otherwise, the rest is perfect ... even the voice is pleasant, professorial ... a lot of greetings and thanks for the tutorial.
@faraznawazsandhu
@faraznawazsandhu 2 жыл бұрын
vector 2 doesn't contain a definition for GetAxis , facing this error while writting the scrip.
@thircidia7024
@thircidia7024 2 жыл бұрын
Great stuff man.
@marcodoesitbetter8675
@marcodoesitbetter8675 4 жыл бұрын
BTW, could you also make tutorial for Cinemachine sprinting animations blend tree please ? Was trying to mix both locomotion scripts/animations from video 1 and 2 but it doesn't look good tho :P I really like movement style from this video
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Yep it’s on the list!
@sp0ngebob561
@sp0ngebob561 4 жыл бұрын
For some reason my character wasnt moving I need help :(
@appleseeds2843
@appleseeds2843 4 жыл бұрын
Same here
@dcsgamesstudios
@dcsgamesstudios 4 жыл бұрын
Same here
@shankaraviji
@shankaraviji 3 жыл бұрын
You should not leave a space in blend tree parameters. Not Like This 👉(Input X, Input Y), Like This 👉(InputX, InputY)
@kakkakaaew3911
@kakkakaaew3911 2 ай бұрын
I follow the step but I can’t move can u tell me why😢 i really need your help
@durgam_sumerian7815
@durgam_sumerian7815 4 жыл бұрын
What an amazing tutorial, I hope to see a similar one for the oculus rift VR, please.
@diduward9360
@diduward9360 2 жыл бұрын
could you add jumping or did you already add it in a future vid?
@billy_avila
@billy_avila 4 жыл бұрын
You've got great stuff keep it up
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Thank you!
@MyMusic-pi6lz
@MyMusic-pi6lz 2 жыл бұрын
My character takes too much time to face the crosshair while turning ... The turn speed is not affecting anything... Plz help anyone...
@TheKiwiCoder
@TheKiwiCoder Жыл бұрын
Slow it down
@sshhiittoo2
@sshhiittoo2 4 жыл бұрын
I have set the value to 0 in Damping of all the fields but the camera keeps moving when I move the character, why can it be? Amazing job and amazing tutorials, thank you!
@Mikelica69
@Mikelica69 2 жыл бұрын
ur a freaking saviour man!!!
@drr1867
@drr1867 4 жыл бұрын
Hi - great series. I'm having problems though. My animation is very jerky - ok when not using cinemachineFreeLook but as soon as switch it on very jerky movements. Not sure what I am missing. I'm not using rigid body - I'm using character controller. Many thanks if you can advise me.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Jerkiness is usually caused by an update order problem. Hopefully my next video will give you some tips on how to solve this
@drr1867
@drr1867 4 жыл бұрын
@@TheKiwiCoder ok thanks for the quick reply - I'll press on then with the next one. Brilliant work - I notice your channel views are growing.
@MeatLabGames
@MeatLabGames 2 жыл бұрын
Hey hey, just a heads up. Does not work in Unity 2022.1.15 (I assume all unity 2022 currently). Went back own to 2021 and it was fine. The reverse animations just skip. Its hard to explain, but needless to say, I wasted a lot of time combing through this video to spot my mistake. So I can't get access to your Discord, it won't erify my legit UK number. Any chance I could DM you my Discord account and get added. Cheers, James
@TheKiwiCoder
@TheKiwiCoder 2 жыл бұрын
Hmm yeah weirdly it looks like they broke root motion. Fun. The work around for now would be computing your own root motion, or do some filtering inside OnAnimatorMove
@zardify_
@zardify_ Жыл бұрын
@@TheKiwiCoder Something very weird is going on even in 2021.3.22f1. - Forward & Backwards as well as Left & Right work fine. Everything looks GREAT in preview while adjusting the sliders. However, the root motion will not work in-between axes'. I even verified that the run-time parameter values are correct, meaning when they are 0.5 and 0.5, and the character should run forwards and right, the right animation is played, but the root motion just snaps to straight horizontal movement............ It's infuriating. It all works in preview. Anyone have a work around?
@zardify_
@zardify_ Жыл бұрын
Never mind. Sometimes voicing things out is what fixes the issue. I've been stuck on this for days, but turns out the issue was overcomplicated code (...as it usually is...). I was turning the character towards the movement vector as well, which put the animation exactly on the lateral axis........... Very hard to debug.
@omarjomaa5810
@omarjomaa5810 4 жыл бұрын
great tutorial! my animations are moving to the corresponding key pressed correctly, but my character is frozen still for some reason :( any tips?
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Thanks! It sounds like root motion is missing from your animation clips, or the root motion checkbox on the animator component is not checked. There are also some setting in the clip to specify which game is the root. Good luck!
@omarjomaa5810
@omarjomaa5810 3 жыл бұрын
@@TheKiwiCoder seems like my root motions are missing since it is checked, any alternative solution for this problem? I've been using Maya to create my animations and exporting the Skeleton + Mesh with the animations baked.
@cfactorygames
@cfactorygames 4 жыл бұрын
My character is flicking rotate! I've tried in Update and FixedUpdate
@aryangovil265
@aryangovil265 4 жыл бұрын
@PatronState bro can u help me
@aryangovil265
@aryangovil265 4 жыл бұрын
@PatronState yaa I was trying to use a virtual camera but my player mouse look script wasn't working
@aryangovil265
@aryangovil265 4 жыл бұрын
@PatronState any idea what to do
@BBoysLibya
@BBoysLibya 2 жыл бұрын
Really amazing tutorial really fun and easy to follow tho i ve a problem when ever my character rotates it keeps moving in a really jittery motion not as smooth as ur character is their a way i can fix this ??
@XboxPlayerPL
@XboxPlayerPL 3 жыл бұрын
Question. Why does my character input X and Y snaps immediately and animation transition doesn't look smooth? I need to lerp it.
@KenazzYT
@KenazzYT 3 жыл бұрын
If any have trouble with the github assets throwing up hundreds of errors, delete EVERYTHING except the specific strafe animations you need :)
@paulberry3359
@paulberry3359 3 жыл бұрын
Hi a bit of a silly question, as I am fairly new to Unity, but was wondering why you do not use the supplied left and backwards animations but instead just reverse the forward and right ones? Many thanks :)
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
That is a good question! I think it blended better..
@paulberry3359
@paulberry3359 3 жыл бұрын
@@TheKiwiCoder Thank you so much for replying
@skeleton649
@skeleton649 3 жыл бұрын
I got a bug in the gravity, it's like Jump, keeps going down slowly
@spideyman1909
@spideyman1909 4 жыл бұрын
BEST TUTORIAL
@regioninteractive6114
@regioninteractive6114 4 жыл бұрын
lookin good
@5252emre
@5252emre 4 жыл бұрын
my character is floating forwards slowly. i use the charactercontroller with that i have o problems. when i use rigidbody its slide backward and if i set the mass about 5 its slide forwards
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Hey, there are two sets of characters in the synty assets. Make sure to use the ones in the FixedScaleCharacters folder. Or if you have a custom character make sure scale is set to 1,1,1 on all game objects in the skeleton.
@5252emre
@5252emre 4 жыл бұрын
@@TheKiwiCoder thx for fast reply. i checked all scales from character mesh and rigs they are already set to 1,1,1. I using the characetr and animations from mixamo. maybe they are not combatible with animation rigging ? and my idle animation is an pistol idle, may i should take a standard idle animation ?
@danielconde001
@danielconde001 4 жыл бұрын
im missing the Cinemachine Camera Offset extension. What could be the problem here?
@SamuelPenning
@SamuelPenning 3 жыл бұрын
Look under "Add Extension" in the bottom of the CinemachineFreeLook component. It's at 14:43 in the video. Took me a while to figure it out, too.
@zzz-hk9zq
@zzz-hk9zq 2 жыл бұрын
10:48 if anyone is having an error, try changing line 13 and instead of using mainCamera = Camera.main; use mainCamera = GameObject.Find("MainCamera").GetComponent();
@mingbinyang3998
@mingbinyang3998 2 жыл бұрын
if you get this error, check if your main camera has a tag Main Camera
@KaptanAmerikenya
@KaptanAmerikenya 2 ай бұрын
@@mingbinyang3998 thx
@andreaswenang5177
@andreaswenang5177 4 жыл бұрын
I have a question, why I can't use 2 cinemachine extensions at the same time? I want to add collision extensions cuz the camera goes through wall
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
It should work?
@andreaswenang5177
@andreaswenang5177 4 жыл бұрын
@@TheKiwiCoder well, it gliched like... yes the camera prevents wall collision a little bit but it still goes through wall
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Andreas Wenang You could try the unity forum, the guys from cinemachine are pretty responsive there.
@mestesso2174
@mestesso2174 3 жыл бұрын
in cinemachine 2.1.10 camera offset addon is not more avaialable... how to solve??
@noahfarnsworth2610
@noahfarnsworth2610 3 жыл бұрын
I can’t move forward with how u set it up? Only diagonal. Help?
@hcyaan
@hcyaan 2 жыл бұрын
Hi! Great tutorial! Where can I find the animations pack that you are using?
@danthonyhill9906
@danthonyhill9906 4 жыл бұрын
Hey Kiwi long time, is there a way to use the turning animation so when rotating the camera it uses the Strafe Rapid Turn Left & Turn Right Animation rather than just stand still ??
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Hey man, good to see you’re still tuned in! You’d need to trigger the animation when the angle distance between the camera and players forward axis raises above a threshold. I haven’t tried that but it’s a start!
@luanius187
@luanius187 2 жыл бұрын
@@TheKiwiCoder Can you do a Tutorial on it? Im a beginner.
@yeahido9072
@yeahido9072 4 жыл бұрын
Just went through tutorial one for everything to be redone again lol
@x1204
@x1204 3 жыл бұрын
hi I am getting an error I don't why : NullReferenceException: Object reference not set to an instance of an object PlayerAim.FixedUpdate () (at Assets/Scripts/NewPlayer/PlayerAim.cs:19) the script is the same as you told my script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerAim : MonoBehaviour { public float turnSpeed = 15; Camera mainCamera; void Start() { mainCamera = Camera.main; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } void FixedUpdate() { float yawCamera = mainCamera.transform.rotation.eulerAngles.y; transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(0, yawCamera, 0), turnSpeed * Time.fixedDeltaTime); } }
@doomslayergaming520
@doomslayergaming520 3 жыл бұрын
Set the main camera tag as MainCamera. It will work
@luanius187
@luanius187 2 жыл бұрын
i have the same problem. did you fix it?
@lemax2980
@lemax2980 4 жыл бұрын
Can you please teach us about procedural animations? Like movement of spider legs on any terrain..would be deeply obliged if you could teach us🙃
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Hey great suggestion, I'd like to know how to do that also, so I'll see what I can do! The new Unity Animation rigging package sounds like it might be useful for this type of animation.
@lemax2980
@lemax2980 4 жыл бұрын
I've setup the IK but still confused about the code.😅
@lemax2980
@lemax2980 4 жыл бұрын
@@TheKiwiCoder yes sir..there are mutiple ways to approach this.we can set this up using any IK tool and some cool code to shift the position of target point attached to each legs and move them accordingly relative to the main centre of mass. It is a super cool technique and has many applications.I am interested and excited to learn from you🙌🤗
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
@@lemax2980 Cool, thanks for the head start haha. This video is really great and shows the power of procedural animation. Definitely worth checking out! kzbin.info/www/bejne/gX3NhYhmrrCGZpI
@termi2828
@termi2828 4 жыл бұрын
How does the movement work? We never set up the wasd keys to move the character but somehow it just works? Also what exactly does Input.GetAxis() do in this script?
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Magic 😂 The horizontal/vertical input axis are mapped to the wasd keys. It’s listed under input in the project preferences.
@termi2828
@termi2828 4 жыл бұрын
@@TheKiwiCoder ahh i see makes sense now
@pietro8450
@pietro8450 2 жыл бұрын
Nice video! Where am I can find the animations that are you using for locomotion? Thank you!
@SamuelArmer
@SamuelArmer 3 жыл бұрын
Help! All my motion configuration settings are correct but when I move the red dot to top right the character runs in a circle Help please :) And when I change the Accel Time and Decel Time to 0.02 the camera just snaps to where it need to be it's not smooth
@shazboi
@shazboi 4 жыл бұрын
my cross hair points to the centre of the character's head when I move right, when I move left it stays offset.. how do I fix it?
@branislavzivanovic4775
@branislavzivanovic4775 4 жыл бұрын
Are you using the old input system or the new input system?
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Old one.
@sp0ngebob561
@sp0ngebob561 4 жыл бұрын
Excuse me in your next tutorials do u mind increasing your font size Nice video, I learnt a lot.
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Thanks for the feedback, sure thing!
@sp0ngebob561
@sp0ngebob561 4 жыл бұрын
@@TheKiwiCoder thanks for the response my man
@appleseeds2843
@appleseeds2843 4 жыл бұрын
@TheKiwiCoder Im having some trouble with my character movement. I can move the camera but I cant move the charater. Any advice?
@appleseeds2843
@appleseeds2843 4 жыл бұрын
And Do you need a controller for this to work??
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
No this video uses a rigid body.
@haithammahmoud6825
@haithammahmoud6825 4 жыл бұрын
sry for ask but can u add camera collision .. so when there's something between player and camera
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Checkout this page. docs.unity3d.com/Packages/com.unity.cinemachine@2.1/api/Cinemachine.CinemachineCollider.html
@creasu124
@creasu124 4 жыл бұрын
I think this easily can be done with a raycast starting from the head + a little distance that it’s not going inside the head to the position of the camera when hitting nothing and if it hit’s something the hit position is the new camera position
@theVSORIGINALs
@theVSORIGINALs 4 жыл бұрын
can i use this starter pack for commercial use i m making game and deciding to publish it on play store
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Check the license on the asset store.
@theVSORIGINALs
@theVSORIGINALs 4 жыл бұрын
@@TheKiwiCoder the license is extension asset so can i use it or not
@aetherproject9274
@aetherproject9274 4 жыл бұрын
@@theVSORIGINALs like he said READ in the assetstore
@brandongrill5132
@brandongrill5132 3 жыл бұрын
Why are my camera and mouse inputs inverted? Ie. When i look up th camera looks down.. *all the code is the exact same so idk if it has something to do with the input variables or what?
@ethanjones5623
@ethanjones5623 3 жыл бұрын
Check the invert properties on the cinemachine camera, almost always have to switch them.
@justinwang2882
@justinwang2882 3 жыл бұрын
is there any way to increase how fast or slow the character move?
@nastyaromanova5902
@nastyaromanova5902 4 жыл бұрын
Hey there :) I have an issue with this character controller and "combining" the animation rigging of the water gun from the previous video. Everything works fine, moving and all the topics that are covered in this video - until I start constraining the hands to the weapon. In game mode, my character starts floating high above the ground and in scene view I've noticed that my character has left his collider?! (the collider stands neatly on the ground...) Any idea? I noticed that all of my used animations are "read only", could this be an issue? Thanks in advance! (sorry for my english)
@TheKiwiCoder
@TheKiwiCoder 4 жыл бұрын
Oh someone else was having this issue, it sounded like it was something to do with exporting from blender. What character are you using?
@nastyaromanova5902
@nastyaromanova5902 4 жыл бұрын
@@TheKiwiCoder yep, again, many thanks. Blender import was the issue. EDIT for further clarification: I had to change the scaling to "FBX All" in the blender export settings and reimport the model to Unity.
@AmgedAlfakih
@AmgedAlfakih 4 жыл бұрын
thank you so much man
@misc-i6q
@misc-i6q 4 жыл бұрын
How do I change the character to my own character I made
@quentin6687
@quentin6687 3 жыл бұрын
Hi ! Thanks for your tutorial ! It's really helpful ! How can I use a mixamo character with animation of the standard assets package ?
@SlitheryEnd03
@SlitheryEnd03 3 жыл бұрын
Please help I don’t know what I’m doing wrong i followed everything but the script aiming doesn’t seem to work
@SlitheryEnd03
@SlitheryEnd03 3 жыл бұрын
this is the error i keep getting NullReferenceException: Object reference not set to an instance of an object characterAiming.FixedUpdate () (at Assets/Scripts/characterAiming.cs:19)
@teo2805
@teo2805 3 жыл бұрын
Incredible video! Wow...! One thing I'd like to do is for the player to only Strafe when pressing down a button, and otherwise, the player would just move and turn towards the sides when not pressed. Any leads? Thanks!
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Hey yeah there is a line in the aiming code which rotates the player. Close that in an if block instead and check if the key is pressed
@luanius187
@luanius187 2 жыл бұрын
How to fix this Bug: NullReferenceException: Object reference not set to an instance of an object CharacterAiming.FixedUpdate () (at Assets/CharacterAiming.cs:19) The Character isn't rotating with the camera
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Can You Beat Minecraft From One Grass Block?
35:27
Beppo
Рет қаралды 4,7 МЛН
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
PERFECT Weapon Aiming! (IK, Unity Tutorial Third Person Shooter)
13:36
Move and Animate a 3rd Person Character in Unity3D
23:10
Jason Weimann (GameDev)
Рет қаралды 103 М.