Animated Enemy + Making him look at the Player
Hey.
I've got an enemy character that came with some animations (walk, run, idle, stand, etc, etc). I haven't done much with the animator in Unity, I'm kinda doing this as a learning exercise.
I want the enemy to look at the player when I'm close enough to him (this is all in VR, so it's very noticable/immersion-breaking when he just stares off into the distance). I attempted this by using a transform.lookAt on the head of the enemy - however this doesn't work (the method is being called, but the LookAt is not doing anything). I think it's because the enemy is animated - I've been looking around for answers on this and read somewhere that an Animator will override any manual transform changes.
If this is the case, how exactly would I go about doing this? Would I have to create an animation of my own for the head rotation?
Thanks for any help. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612213052im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Animator and code controlled bone rotations 0 Answers
How to ignore a value while animating 0 Answers
Broken animations in Unity 5.3.5f 1 Answer
Problem with rotating object that has animator attached 1 Answer
How to create a seamless looping animation, without noticing when the loop occurs? 1 Answer