The question is answered, right answer was accepted
Need Help With Having Enemy Arms Pointed at Player
I am making a stealth game, and currently my enemies will follow the player if he/she is in the line of sight. That works all well and great, but if my player is on a ledge and is spotted, the enemy doesn't look up to them, just whatever is in front of them. I want my enemies' arms and head to look/point at the player, and override transforms in the animation playing. I put my rotation script in LateUpdate, which overrided the current transforms in the animation, but I can't get it to point like I want it to. To clarify, I just want the arms and the head rotating up and down (the local x axis) and nowhere else, as the body takes care of sideways rotation. Please help, I have tried a couple methods but I would like to know what y'all think. Thanks in advance.
Answer by N-8-D-e-v · Jun 20, 2020 at 02:49 PM
I haven't gotten it working the way I want it to yet, but I feel I'm very close, I'm using avatar mask and state machine layers https://docs.unity3d.com/Manual/AnimationLayers.html https://docs.unity3d.com/Manual/class-AvatarMask.html