Im trying to SLERP a child transforms rotation Y but its not working. The Y gets to the destination angle after the time set for the SLERP but no transition effect is vissible. So i see the transform at 0 all the time and then suddenly its at 180.
public IEnumerator SlerpRotationY (float durationSeconds, float targetAngle)
{
float flipSpeed = 5F;
var flipRotation = Quaternion.Euler (0, targetAngle, 0);
float t = Time.deltaTime;
while (t < durationSeconds) {
cardSides.rotation = Quaternion.Slerp (transform.rotation, flipRotation, Time.deltaTime * flipSpeed);
yield return null;
t += Time.deltaTime;
}
if (targetAngle == 180) {
isShowingFront = false;
} else {
isShowingFront = true;
}
}