Hi, I’m working on a little stickman that has eyes.
I want it so that the eyes look at my mouse. I coded that and it worked.
but I want it so that the eyes slowly move and not instantly. I’m currently
using this line of code
bodyParts[1].transform.position = new Vector3(Mathf.Clamp(mousePos.x / xEyeSensitivity, -0.4f * gameObject.transform.localScale.x, 0.4f * gameObject.transform.localScale.x),Mathf.Clamp(mousePos.y / yEyeSensitivity, -0.6f * gameObject.transform.localScale.x, 0.5f * gameObject.transform.localScale.x) -1f,bodyParts[1].transform.position.z);
The Mathf.clamp is so the eyes don’t go too far from his head, the xEyeSensitivity/yEyeSensitivity are there so
the eyes don’t follow my mouse and the * gameObject.transform.localScale.x is there so when I scale up my sttickman things stay in place.
I thought I need to do something with Time.deltaTime but that didn’t work,
does anyone have an idea on how to make the eyes slowly look to the eyes?