This looks really promising. What if I have an animated character with head and facial animation? Would anyone know how to add this behavior, without losing the head and facial animation?
I have the same problem ... I solved it by making my character look at a GameObject in the exact position I want, Example: My character was looking at my enemy's feet for some reason, so I create a new GameObject and attach it to the head of my Enemy and I change the transform to this new GameObject and the problem is gone :)
I was annoyed for hours about why it didn't work for me and it only worked as soon as I checked "IK Pass" to enabled in the animator. You didn't show this step, which is why it at least didn't work for me!
@@souhailla10 No. I dont mean your "ik aktive" checkbox of his script inside of the the Inspector. I mean a checkbox inside of the "animator" Tab, of his used Layer.. You have to check the checkbox inside of the gear, of the layer, inside the Animator or it will not work no matter if your "ik aktive" checkbox is checked or not. (And in this Video the Animator is never shown up) But here: th-cam.com/video/13a_qoU1ot8/w-d-xo.html
Hi. How do you slow the head rotating in that direction? Like if you were to switch to another object. The head, in my case, snaps too quickly in that direction. I am actually using this for navmesh navigation, where the avatar looks in the new direction, but its unnaturally fast.
Hello, I was having a similar problem. Did you happen to find a fix for this at some point? I wanted a character to look at the player if you got close to them, so I was trying to enable and disable the look movement in a smooth way, because at the moment it just unnaturally snaps.
How can I modify this to look at multiple objects? I would like my players to look at things that can be interacted with, like keys, papers or doors, and this is more than one object.
Place those objects in an array and use a for loop to identify which of them is closest to the player character. Then, just make the character look at the object that has been identified as having the shortest distance from them.
I don't think that is true. I was not using a pro version and I recently implemented something similar which was working just fine, also with just the plain standard version. I'm gonna double-check that.
Hi. I think you have to tell them to turn on the IK animation in the animation as well. Thats why its not working for everyone.
THX man !
This looks really promising. What if I have an animated character with head and facial animation? Would anyone know how to add this behavior, without losing the head and facial animation?
If it doesnt work, make sure that your characters animation type is set to humanoid!
How does this method know which bone is the head bone?
yeah i dont get it too..
You can see parameters on SetLookAtWeight, have (float weight, float bodyweight) +4, can find on method definition by clicking right click.
Thanks :)
This isn't working for me...is it because am using animations from mixamo ?
Maybe turn on IK animation in the animation panel.
Go to your Animator , then in your Base Layer clic on the little gear and check the IK Pass option and that's will fix your problem
works, but my character isn't looking at the target I want, he seems to look at a spot in the ground, I wonder what's wrong
I have the same problem ... I solved it by making my character look at a GameObject in the exact position I want, Example: My character was looking at my enemy's feet for some reason, so I create a new GameObject and attach it to the head of my Enemy and I change the transform to this new GameObject and the problem is gone :)
I Really Like Your Channel!!!
I was annoyed for hours about why it didn't work for me and it only worked as soon as I checked "IK Pass" to enabled in the animator.
You didn't show this step, which is why it at least didn't work for me!
he did mentioned it in 2:10 buddy .. pay atention boy ;-) ( like foghorn leghon justed to say )
@@souhailla10 No. I dont mean your "ik aktive" checkbox of his script inside of the the Inspector.
I mean a checkbox inside of the "animator" Tab, of his used Layer.. You have to check the checkbox inside of the gear, of the layer, inside the Animator or it will not work no matter if your "ik aktive" checkbox is checked or not. (And in this Video the Animator is never shown up)
But here: th-cam.com/video/13a_qoU1ot8/w-d-xo.html
@@letmedwight WOW !!! your right about that !! haha .. thats why it didn't work with my project either in the first place.. thankyou :-)
This is great but it should be more smooth so it doesn't look so unnatural lol
Hi. How do you slow the head rotating in that direction? Like if you were to switch to another object. The head, in my case, snaps too quickly in that direction. I am actually using this for navmesh navigation, where the avatar looks in the new direction, but its unnaturally fast.
Hello, I was having a similar problem. Did you happen to find a fix for this at some point?
I wanted a character to look at the player if you got close to them, so I was trying to enable and disable the look movement in a smooth way, because at the moment it just unnaturally snaps.
Is there way to use this but make it look at the center of the screen if u know what I mean
I knew that cube was up to something shady...
How can I modify this to look at multiple objects?
I would like my players to look at things that can be interacted with, like keys, papers or doors, and this is more than one object.
Place those objects in an array and use a for loop to identify which of them is closest to the player character. Then, just make the character look at the object that has been identified as having the shortest distance from them.
nicee
you sound like pewdiepie xd
This only works if you have the pro version of Unity.
- answers.unity.com/questions/401072/mecanimanimator-setlookatposition-not-working.html
I don't think that is true. I was not using a pro version and I recently implemented something similar which was working just fine, also with just the plain standard version. I'm gonna double-check that.
that is not true...
That's not true x2