I had a question about the camera, is it possible to rotate the character without the camera rotating with it? (like when I press "A" the character rotates to left) I tried to do it but my camera rotates with my player character.
@@samankargar6708 Try moving the LookAt out of the player hierarchy, and then attaching a quick script to the LookAt to make just the transform equal to the player's transform (and not the rotation). Worked for me :)
@@bezoro-personal Well actually I think there isnt rly much more which Brackeys could have tell us. Maybe a reason more why he stopped. He already has a tutorial or an tutorial LIKE video about nearly everything you can show which isnt deep. So it was never a channel which advanced ppl needed.
For anyone who is watching currently, you need to use Cinemachine Third Person Follow. Add a Cinemachine Brain to the camera you wish to use (e.g. Main Camera) and then attach a Cinemachine Camera and the Cinemachine Third Person Follow to the virtual game object, and then follow from there.
Very impressive stuff, unity is making it easier and easier to make more complex games. Before I never thought about creating a full 3d game alone, but now its looking possible.
thank you so much for linking the Unity Royale Project. I've seen so many Unity tutorials use assets from there, but didn't know where the project was.
Me when I code: "I need this to go fast... let's try Uhhhh.... 1500... No... *700... No... 400? Yeah that looks ok." Unity: "343 meters is the speed of sound." Me: ".../cough/ yeah I knew that...."
Good video tutorial. After the aim status, you can use a virtual camera to follow a short time range the arrow even shows the effect on the target. The change of camera for aim staus need to be short.
Thank you so much for the bit of information about what object the camera should rotate starting around the 3:32. I've been trying to get my rpg camera controller to pan around the player if I hold left click, and to drive the player movement direction when I hold right click. Your solution is so simple and I was overcomplicating it.
Guys, if you can't find the third person follow option, it could be cause you're using the latest cinemachine version. Don't forget he's using the 2.6.0 versión in the package manager
RE the aiming camera or target/projectile offset 9:00 - might help someone else to know that Resident Evil 2 solved this using hit-scan from the camera not from the player model.
I was trying to replicate this tutorial, but since in this proyect (the Unity Royale Project ) there are not the same assets ( I mean the scripts PlayerInput, PlayerMovement, PlayerAimController and so on...) it is being quite a bit difficult, since I needed start by programming something similar. It would help if you give us this scenario. Thanks a lot, and anyway this is a great tutorial.
BROOOO I NEEDDED THIS. I feel like there are alot of things in Unity without a Tutorial. Like how to use the particle effects in detail, what every litle thing does, things like that.
In my testing, the camera did not automatically move to and focus on the player's forward position. I ended up making the look-at-target the Follow Target game object to get my camera to look that way. I'm not sure if I messed up somewhere, but this was the only way I could get it looking in the right direction.
Is your player snapping when it rotates? Does that annoy you? I responded below to a comment about the character snapping to the followTarget's rotation. Reposting it here for more visibility. The Problem: The transform.rotation value of the player is being set instantly, which leads to player snapping away from the camera when the player starts moving. This is undesirable behaviour. We want a smooth rotation from the player's current rotation to that dictated by the camera. The Solution: First, make sure your follow target is NOT A CHILD OF THE PLAYER. If the follow target is parented to the player, this approach will fail. Next, give your movement script a reference to the followTarget transform. In the mover's update function, always set the position of the followTransform to that of the mover. Then, only when the mover is moving (MoveInput != Vector2.zero), Lerp the mover's transform from its current rotation to that of followTransform (only on the y axis). Unlike the video, I never reset the followTransform's y rotation to zero. See the pseudo code below and let me know of any questions. Happy to Help! public class Mover : Monobehaviour { [SerializeField] private Transform followTransform; private float rotationSpeed = 10; private Vector2 MoveInput; public void Update() { followTransform.position = transform.position; ... if(MoveInput != Vector2.zero) { Quaternion targetRotation= Quaternion.Euler(0, followTransform.rotation.eulerAngles.y, 0); transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * rotationSpeed); } } }
Make sure you select the main camera in your scene before clicking Create Virtual Camera! Its unclear to me where you put the first script that was created.
@@ivandamyanov Check if you installed the 2.6.0 version of Cinemachine. I had the same problem and installing the same version version as the tutorial (2.6.0) solved it :)
I'm not trying to be disrespectful, but I'm not so sure that this tutorial is in my wheel house. A lot of the variables and things presented here, went really fast in the video so I wasn't able to really pick up on anything besides some of the basic camera setups in the beginning. I understand we can download the final project, but I'm not as much interested in the base files as I am in learning the fundamental aspects of this through a more regulated pace(aka: Learning to construct the scripts from scratch so I can learn the process without having to download a bunch of unnecessary files that I won't be using for my project anyways), so maybe this wasn't the right source to go to for a beginner? I'm not one to make judgement though. I am not calling this tutorial bad(because it certainly is not, it touches upon a lot of great subjects), I'm only stating that it was a little too rapid for me. Does anyone have a link to a video that might be a bit more mild-paced for beginners?
This was good but a bit fast paced, and please don't show images of the source code, write it out in the video. Would help with the digestion of all the info coming at us :)
notes for anyone watching this in 2022 With the newer versions, Cinemachine no longer appears in the main menu. You'll find it in the GameObject menu, or if you right-click on the hierarchy.
Dude just make it a top-down camera that follows the player by lerping the camera coordinates. It's much easier than a third-person camera, it doesn't even need to rotate.
The problem is that a lot of newbies to Unity don't know this kind of thing exists, so they waste time and become frustrated by following questionable tutorials on how to hand-hack some garbage that ultimately just doesn't work. They look at other Unity devs and AAA releases that do these things perfectly... and eventually just become depressed and give up. Source: me. The same goes for the new Input System. It's so much better, but newbies are drawn to the old one because that's what all the old tutorials use.
For anyone who is curious on how to achieve this, this video isn't for you. It's basically an overview on what cinemachine can do in 2.6... Don't waste your time.
Hey there! We don't have any ECS updates to share at this time, but rest assured it is something the team is still actively working on! Please keep an eye on our Blog, as we’ll be sharing regular development updates. blogs.unity3d.com/
Coming back to this a year later, Some things I kind of understand.. but it still passes right by me(it feels like I'm being talked to by a teacher that goes at their own pace and not the students if that's the right wording). One thing I would've made different in my approach to getting this information across, would be a concise explanation on *how* the code is meant to be implemented, *where* it should go, and *why* does it work(all of this being related in more simple terms.) He speaks like we already know exactly how C# works and needs to be structured, which is very problematic for most viewers. If I could give some advice to Unity, it would be much appreciated if you made an updated video that is more heavily focused on helping newcomers understand how Unity works and how to apply these functions to our own games. The way the video was prepared was more focused on the way "this" game is built, and isn't really as adaptable to other projects due to the lack of information on how scripts and bits of code should be layered. In relative speaking I understand that he is presenting this from his level of experience, and we could easily go to a new video to learn how to adapt this to our projects... but do you guys understand how annoying it can be for most people to switch between two different videos just to understand where the code from one video should go in the second? Some people just don't have the attention-span(especially people like me with ADHD which literally thrive off dopamine) to stay with it if it's too complicated. Also for any of you who don't have ADHD, imagine that feeling you get when you don't want to do something... but it's ALWAYS THERE if you don't enjoy it enough. All of these problems can be solved with mileage and experience.. but the initial start is what draws people to want to keep coding and creating in the first place. That's just my two cents tho so take it as you will. I wish all new coders the best with their projects and cant wait to see what you guys make!
I have ADHD pretty severely. And I'm telling you man, if you don't like having 200 tabs open while cross referencing things. Programming is not for you. That's literally what your life is in programming, also another tip for adhd programmers is READ things instead of watching. Video tutorials are the ADHD enemy. Also, the code that he was writing is really basic and straight forward, maybe go get more comfortable with coding before hoping into this.
I had that, cinemachine 2.7.3 or something, i uninstalled and went to 2.6.0. Worked like the video. However i cant get the scripts working so its a bust overall.
@@peeei7423 It may say "up to date" but you can still find newer releases available. I had the same problem, when i first installed it, it downloaded version 2.3.2 i think, then i checked again and found 2.6+ available that actually had the "Follow 3rd person" feature.
That's a good tutorial thanks. Please, in the Editor my cinemachines are great but on a build they are pretty slow(very slow)and that's not the whole game just the cinemachines camera, how can I make my cinemachine smoother after making a buid
Do u have video how to set up character mesh to aviche aim effect. I mean, while u aiming and move camera then ur character also move top (head, torso, schoulders, bow).
Great explanation. Question to anyone that might be able to help: How would I make the character rotate towards the direction of where it's going (right, left, backwards) without the camera snapping to behind the character when he does. Thanks in advance :)
Hi Wob Zone, I too was experiencing this problem and it annoyed me. I have a solution that feels slightly hacky but I don't think it compromises performance and it is pretty intuitive. The Problem: The transform.rotation value of the player is being set instantly, which leads to player snapping away from the camera when the player starts moving. This is undesirable behaviour. We want a smooth rotation from the player's current rotation to that dictated by the camera. The Solution: First, make sure your follow target is NOT A CHILD OF THE PLAYER. If the follow target is parented to the player, this approach will fail. Next, give your movement script a reference to the followTarget transform. In the mover's update function, always set the position of the followTransform to that of the mover. Then, only when the mover is moving (MoveInput != Vector2.zero), Lerp the mover's transform from its current rotation to that of followTransform (only on the y axis). Unlike the video, I never reset the followTransform's y rotation to zero. See the pseudo code below and let me know of any questions. Happy to Help! public class Mover : Monobehaviour { [SerializeField] private Transform followTransform; private float rotationSpeed = 10; private Vector2 MoveInput; public void Update() { followTransform.position = transform.position; ... if(MoveInput != Vector2.zero) { Quaternion targetRotation= Quaternion.Euler(0, followTransform.rotation.eulerAngles.y, 0); transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * rotationSpeed); } } }
Very cool tutorial. I also like the stylized characters, building and environment. I didn't found that kind of any stylized human characters in unity asset store. If someone sell it, I would love to buy it.
If this was done less than two months ago then why is third person not an option under body? Edit: Might be a version issue, checking. edit edit: Version issue ,needed to update (for some reason package manager did not default to current version)
can someone help me, I'm trying to learn how to use the scripts but I don't know where to add them as components? mainly my character isn't moving - any advice on this?
You can download the final project with the camera setup here:
on.unity.com/36nVNzt
Thank you so much.
I had a question about the camera, is it possible to rotate the character without the camera rotating with it? (like when I press "A" the character rotates to left)
I tried to do it but my camera rotates with my player character.
@@samankargar6708 I also ran into this. Haven't you found a way to remove camera rotation while following the player?
@@samankargar6708 Try moving the LookAt out of the player hierarchy, and then attaching a quick script to the LookAt to make just the transform equal to the player's transform (and not the rotation). Worked for me :)
@@joshuablazer123 Thanks for the help
It works now.
Now Brackeys has quit. You are my only hope.
Agreed
lmao
😆😆
Dont worry. Someone new will "replace" him very soon. I'am sure.
@@bezoro-personal Documentation 🤣
Good joke. Its just to time consuming.
@@bezoro-personal Well actually I think there isnt rly much more which Brackeys could have tell us.
Maybe a reason more why he stopped.
He already has a tutorial or an tutorial LIKE video about nearly everything you can show which isnt deep.
So it was never a channel which advanced ppl needed.
For anyone who is watching currently, you need to use Cinemachine Third Person Follow. Add a Cinemachine Brain to the camera you wish to use (e.g. Main Camera) and then attach a Cinemachine Camera and the Cinemachine Third Person Follow to the virtual game object, and then follow from there.
Very impressive stuff, unity is making it easier and easier to make more complex games. Before I never thought about creating a full 3d game alone, but now its looking possible.
Absolutely, unity is a god send, how is your journey doing?
he's dead @@LunarBulletDev 💀
Wow, they actually listened and made almost real tutorial with an explanation on what is going on, nice👏
Yeah really!
The key word is "almost"
@@kisstepan Exactly!
thank you so much for linking the Unity Royale Project. I've seen so many Unity tutorials use assets from there, but didn't know where the project was.
this is the 8th time I am watching this video,
every project it comes back all over again xD
Wow, I think I found the golden tutorial, can’t wait to try it out.
Me when I code:
"I need this to go fast... let's try Uhhhh.... 1500... No... *700... No... 400? Yeah that looks ok."
Unity:
"343 meters is the speed of sound."
Me:
".../cough/ yeah I knew that...."
Good video tutorial. After the aim status, you can use a virtual camera to follow a short time range the arrow even shows the effect on the target. The change of camera for aim staus need to be short.
Great video. Also I don't know if it's worth to say, but I love the way the host is talking. He sounds like a great guy 👌
Thank you so much for the bit of information about what object the camera should rotate starting around the 3:32. I've been trying to get my rpg camera controller to pan around the player if I hold left click, and to drive the player movement direction when I hold right click. Your solution is so simple and I was overcomplicating it.
Guys, if you can't find the third person follow option, it could be cause you're using the latest cinemachine version. Don't forget he's using the 2.6.0 versión in the package manager
Thanks! Just updated to beta 🤞
This is all good, but i dont know... cross hair seems off to me
Rotate the target object! That's a good trick. A lot simpler than what I have been doing.
only 11 minutes and some seconds. You Ujnity Tech people are really amazing.
unitys particle system is life
RE the aiming camera or target/projectile offset 9:00 - might help someone else to know that Resident Evil 2 solved this using hit-scan from the camera not from the player model.
Great video please keep making more. Tilemap system seems unfinished, would love an update for that and tutorials.
I was trying to replicate this tutorial, but since in this proyect (the Unity Royale Project ) there are not the same assets ( I mean the scripts PlayerInput, PlayerMovement, PlayerAimController and so on...) it is being quite a bit difficult, since I needed start by programming something similar. It would help if you give us this scenario.
Thanks a lot, and anyway this is a great tutorial.
Oh my god! Unity is so good ☺☺! Keep going unity workers, 👍👍👍 to u,
Respect ur efforts!
Nice Cinemachine tutorial! 🤓🧡
BROOOO I NEEDDED THIS. I feel like there are alot of things in Unity without a Tutorial. Like how to use the particle effects in detail, what every litle thing does, things like that.
its priceless. the slickness and the passion of the devs. priceless. what is cheaper and better than soft? Piracy is NOT the answer if you
So satisfying just watching this gameplay and all effects 🙂
This actually worked well! Thank you!
This needs to be updated for the Unity 2021 . Cinemachine installation changed a bit etc
Project link is does not contain this scene, please upload the project shown in the video thanks
hahaha...
I can also see my seeker stone missing, please upload it in a moment, thanks in advance
Excellent work.
After around 4 minutes, I have no idea what's going on as far as coding and the additional settings go lol other than that, this was a great video
Awesome video!
can you share the rotation mouse look
3:43 where i can script like that?
Thanks Unity, really cool!
We are unity !!
I love that character!
We need more of 3rd person shooter
Amazing video, thank you so much
This is awesome, than you so much
1 like, 1 respect for brackeys
Very well done! Thanks!
cool tutorial, thx you
3:22 Anybody understood how to set up the mouse movement script? I didn't get that part.
@Unity could you help us understand this?
man. Thank you!
In my testing, the camera did not automatically move to and focus on the player's forward position. I ended up making the look-at-target the Follow Target game object to get my camera to look that way. I'm not sure if I messed up somewhere, but this was the only way I could get it looking in the right direction.
The tutorial was almost perfect. The code just didn't show what _look was so I had to download the project to find out what that was.
Great Video. Thanks.
Please make a tutorial about particle system with more details.
I really need some knowledge about it.🙏🙏🙏🙏
Justo lo que necesitaba
Is your player snapping when it rotates? Does that annoy you? I responded below to a comment about the character snapping to the followTarget's rotation. Reposting it here for more visibility.
The Problem: The transform.rotation value of the player is being set instantly, which leads to player snapping away from the camera when the player starts moving. This is undesirable behaviour. We want a smooth rotation from the player's current rotation to that dictated by the camera.
The Solution: First, make sure your follow target is NOT A CHILD OF THE PLAYER. If the follow target is parented to the player, this approach will fail. Next, give your movement script a reference to the followTarget transform. In the mover's update function, always set the position of the followTransform to that of the mover. Then, only when the mover is moving (MoveInput != Vector2.zero), Lerp the mover's transform from its current rotation to that of followTransform (only on the y axis). Unlike the video, I never reset the followTransform's y rotation to zero.
See the pseudo code below and let me know of any questions. Happy to Help!
public class Mover : Monobehaviour
{
[SerializeField] private Transform followTransform;
private float rotationSpeed = 10;
private Vector2 MoveInput;
public void Update()
{
followTransform.position = transform.position;
...
if(MoveInput != Vector2.zero)
{
Quaternion targetRotation= Quaternion.Euler(0, followTransform.rotation.eulerAngles.y, 0);
transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * rotationSpeed);
}
}
}
Thank you so much!!! It took me days to find a solution to this problem.
Make sure you select the main camera in your scene before clicking Create Virtual Camera!
Its unclear to me where you put the first script that was created.
Can't figure out why, it always ends up as a first person camera. I tried what you suggested and the result is the same :X
@@ivandamyanov Check if you installed the 2.6.0 version of Cinemachine. I had the same problem and installing the same version version as the tutorial (2.6.0) solved it :)
Please make more tutorials because brakeys left
I'm not trying to be disrespectful, but I'm not so sure that this tutorial is in my wheel house. A lot of the variables and things presented here, went really fast in the video so I wasn't able to really pick up on anything besides some of the basic camera setups in the beginning.
I understand we can download the final project, but I'm not as much interested in the base files as I am in learning the fundamental aspects of this through a more regulated pace(aka: Learning to construct the scripts from scratch so I can learn the process without having to download a bunch of unnecessary files that I won't be using for my project anyways), so maybe this wasn't the right source to go to for a beginner? I'm not one to make judgement though.
I am not calling this tutorial bad(because it certainly is not, it touches upon a lot of great subjects), I'm only stating that it was a little too rapid for me. Does anyone have a link to a video that might be a bit more mild-paced for beginners?
Brakeys
yeah, same I just couldn't get what he said and as you said everything was explained too quickly.
@@notrue4u you can pause it. And then after you understand, hit play again. This way it will be explained at whatever speed you want.
Because you are dumb
This was good but a bit fast paced, and please don't show images of the source code, write it out in the video. Would help with the digestion of all the info coming at us :)
LOL guys. Its 2020 and you make a sample project of your own technology in 2019 version (or older) of your own product. WOW. Just wow
2019 version is better because it has LTS
notes for anyone watching this in 2022
With the newer versions, Cinemachine no longer appears in the main menu. You'll find it in the GameObject menu, or if you right-click on the hierarchy.
this is good, with free cam is worst, thanks unity
Need a similar video for a Diablo like camera :)
Pleeeease
Dude just make it a top-down camera that follows the player by lerping the camera coordinates. It's much easier than a third-person camera, it doesn't even need to rotate.
The problem is that a lot of newbies to Unity don't know this kind of thing exists, so they waste time and become frustrated by following questionable tutorials on how to hand-hack some garbage that ultimately just doesn't work. They look at other Unity devs and AAA releases that do these things perfectly... and eventually just become depressed and give up.
Source: me.
The same goes for the new Input System. It's so much better, but newbies are drawn to the old one because that's what all the old tutorials use.
The script you mentioned for rotating the camera, can you share that?
yeah i need that too
The whole project is available for download in the description.
For anyone who is curious on how to achieve this, this video isn't for you. It's basically an overview on what cinemachine can do in 2.6... Don't waste your time.
Can someone tell me where to download the project files
look before u ask, its in the description
When would ECS will be available in stable release? It's not present in my 2020.4
Hey there! We don't have any ECS updates to share at this time, but rest assured it is something the team is still actively working on!
Please keep an eye on our Blog, as we’ll be sharing regular development updates.
blogs.unity3d.com/
Coming back to this a year later, Some things I kind of understand.. but it still passes right by me(it feels like I'm being talked to by a teacher that goes at their own pace and not the students if that's the right wording).
One thing I would've made different in my approach to getting this information across, would be a concise explanation on *how* the code is meant to be implemented, *where* it should go, and *why* does it work(all of this being related in more simple terms.)
He speaks like we already know exactly how C# works and needs to be structured, which is very problematic for most viewers.
If I could give some advice to Unity, it would be much appreciated if you made an updated video that is more heavily focused on helping newcomers understand how Unity works and how to apply these functions to our own games. The way the video was prepared was more focused on the way "this" game is built, and isn't really as adaptable to other projects due to the lack of information on how scripts and bits of code should be layered.
In relative speaking I understand that he is presenting this from his level of experience, and we could easily go to a new video to learn how to adapt this to our projects... but do you guys understand how annoying it can be for most people to switch between two different videos just to understand where the code from one video should go in the second? Some people just don't have the attention-span(especially people like me with ADHD which literally thrive off dopamine) to stay with it if it's too complicated.
Also for any of you who don't have ADHD, imagine that feeling you get when you don't want to do something... but it's ALWAYS THERE if you don't enjoy it enough.
All of these problems can be solved with mileage and experience.. but the initial start is what draws people to want to keep coding and creating in the first place. That's just my two cents tho so take it as you will. I wish all new coders the best with their projects and cant wait to see what you guys make!
I have ADHD pretty severely. And I'm telling you man, if you don't like having 200 tabs open while cross referencing things. Programming is not for you. That's literally what your life is in programming, also another tip for adhd programmers is READ things instead of watching. Video tutorials are the ADHD enemy. Also, the code that he was writing is really basic and straight forward, maybe go get more comfortable with coding before hoping into this.
bro if you have problem with this after a YEAR then the problem might be you not the video ...
see what u just wrote there.. thats what u wanna do in visual studio
Thanks
I keep creating the virtual camera but it's in the ground or too close to the character, nto sure what I'm doing wrong here.
I had that, cinemachine 2.7.3 or something, i uninstalled and went to 2.6.0. Worked like the video. However i cant get the scripts working so its a bust overall.
Potát Approve :D
HELP MY CINEMACHINE BODY DOENST HAVE A "third person follow " ON IT.
ITS STUCK ON TRANSPOSER
It seems like you have an old version of Cinemachine, update it from the package manager
@@AndresGomez-uo8st but it says up to date in my package manager
edit : does it have something to do with the fact that im making a mobile game?
@@peeei7423 It may say "up to date" but you can still find newer releases available. I had the same problem, when i first installed it, it downloaded version 2.3.2 i think, then i checked again and found 2.6+ available that actually had the "Follow 3rd person" feature.
@@Xsjr03 so uuuh, how exactly can i fix that?
I know I have *The Exact Same Problem* And I've been roaming the comments to find the answer!!!
Good viedeo
Please share the Project Files, along with this the finished implementation of this tutorial (so we can review/references it)! cheers :)
You forgot to mention that by enabling and disabling, the cameras keep the last position before disabling
😍😍😍
Basically it adds linear interpolation from one position to another, this can be done with a lerp() function.
Thanks unity.
Cool
Doesn't cinemachine already have a 3rd person camera rig? The extra script in this video seems redundant and less customizable.
update your cinemachine from package manager
That's a good tutorial thanks.
Please, in the Editor my cinemachines are great but on a build they are pretty slow(very slow)and that's not the whole game just the cinemachines camera, how can I make my cinemachine smoother after making a buid
Hi, how did u made the bow and arrow function? Plz make a tutorial
watch the video.. or download their files and look for yourself
man i want that ik bow aiming tutorial lol
how do we do that?
Do u have video how to set up character mesh to aviche aim effect. I mean, while u aiming and move camera then ur character also move top (head, torso, schoulders, bow).
i love your vidios (copy past this to make this happen)
Thank you!!!
I can't control the camera how do I do it it 2019.4?
The project download does not have the movement of the tutorial character.
Im facing the same problem
why did you leave out the fact that you have to add a CinemachineBrain to the main camera?
The Github project does not contain the actual code presented in this video?
How to point camera to CG pictures or mp4cutscenes in the scene
Place your Picture or Video inside an Invisible Object, like a Cube, make the camera point to the 3d Object which contains your video, picture
How do you change the camera distance in C# while using the 3rd Person Follow?
How about the collision of camera with obstacles? I'm curious.
Same
Great explanation.
Question to anyone that might be able to help:
How would I make the character rotate towards the direction of where it's going (right, left, backwards) without the camera snapping to behind the character when he does.
Thanks in advance :)
Hi Wob Zone,
I too was experiencing this problem and it annoyed me. I have a solution that feels slightly hacky but I don't think it compromises performance and it is pretty intuitive.
The Problem: The transform.rotation value of the player is being set instantly, which leads to player snapping away from the camera when the player starts moving. This is undesirable behaviour. We want a smooth rotation from the player's current rotation to that dictated by the camera.
The Solution: First, make sure your follow target is NOT A CHILD OF THE PLAYER. If the follow target is parented to the player, this approach will fail. Next, give your movement script a reference to the followTarget transform. In the mover's update function, always set the position of the followTransform to that of the mover. Then, only when the mover is moving (MoveInput != Vector2.zero), Lerp the mover's transform from its current rotation to that of followTransform (only on the y axis). Unlike the video, I never reset the followTransform's y rotation to zero.
See the pseudo code below and let me know of any questions. Happy to Help!
public class Mover : Monobehaviour
{
[SerializeField] private Transform followTransform;
private float rotationSpeed = 10;
private Vector2 MoveInput;
public void Update()
{
followTransform.position = transform.position;
...
if(MoveInput != Vector2.zero)
{
Quaternion targetRotation= Quaternion.Euler(0, followTransform.rotation.eulerAngles.y, 0);
transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * rotationSpeed);
}
}
}
@@blgamedev thanks, this is just what I needed
Very cool tutorial. I also like the stylized characters, building and environment. I didn't found that kind of any stylized human characters in unity asset store. If someone sell it, I would love to buy it.
What OS systems do cinemachine support? Thanks you
Ok but where do I get the variable _look?
can the cinemachne in a 3d project
yeahhh
If this was done less than two months ago then why is third person not an option under body? Edit: Might be a version issue, checking. edit edit: Version issue ,needed to update (for some reason package manager did not default to current version)
TY for pointing out the version mismatch!
How do you get the camera to rotate back behind the character
I tried downloading this project, it says "Insufficient permissions", and there's nothing I can do about it. Any other alternatives?
can someone help me, I'm trying to learn how to use the scripts but I don't know where to add them as components? mainly my character isn't moving - any advice on this?
All I want is a simple fly through. Can you do a video on that? or anyone know if there is a good video on this?
I didn't understand how to fix the aim and target