I want to make it so my gameobject rotates in a smooth fashion to the angle I want, I have a code that works but it makes everything jerk around and is very sloppy… so any help cleaning this up?
if (walkcontrol == 1) {
yRotation = Random.Range(1f, 33333333F);
yRotation += Input.GetAxis("Horizontal");
myTransform.eulerAngles = new Vector3(transform.rotation.x, yRotation, 0);
walkcontrol = 2;
}
//move towards target
if (walkcontrol == 2) {
StopCoroutine("MyMethod2");
myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
animation.Play("walk");
StartCoroutine("MyMethod");
}