I'm trying to make a C# for enemy to aim at player, but I don't know how to rotate the weapon: In hierarchy, the weapon is inside the right hand. I tried the basic IK example at the unity documentation page. I modified it and I have this: Code (CSharp): private void OnAnimatorIK() { animator.SetLookAtWeight(1); animator.SetLookAtPosition(PlayerTarget.position); animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1); animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 1); animator.SetIKPosition(AvatarIKGoal.RightHand, PlayerTarget.position); animator.SetIKRotation(AvatarIKGoal.RightHand, PlayerTarget.rotation); } The PlayerTarget is inside Player, but the gun isn't rotating at the player and it is modified by player rotation. If I turn around 180 the enemy's arm is also rotating the arm. I tried to put the target outside the Player and make it follow player by script, but without rotation, only position. It isn't also working. Do you have an IK enemy aiming a gun at player script? Thanks!
Check out this tutorial, it explains exactly what you're looking for and it's free for 3 months https://learn.unity.com/project/c-survival-guide-rotations?courseId=5cf06bd1edbc2a58d7fc3209
Oh, sorry, my bad. I misread your post. But you can check out the tutorial, hopefully it helps a little. I'm too noob to give advice, sorry lol