I have a transform which is the player’s head bone, and I want to rotate it towards the opponent smoothly. Right now, with the following code, the player’s head rotates towards the opponent as expected, but it is not smooth. As soon as the condition is met, the player’s bone rotation just jumps to the expected rotation. I want it to look smooth:
Vector3 look = GameObject.FindGameObjectWithTag("Opponent").transform.position-bone.position;
bone.forward = look;
bone.localEulerAngles = new Vector3(bone.localEulerAngles.x, 8, 0); //to maintain the other axis from changing //x is apparently the local axis in this case that makes the player's head rotate left to right