#Overshoot with Slerp and AnimationCurve

1 messages · Page 1 of 1 (latest)

craggy bison
#

so basically I want to slerp from one quaternion to another but after reaching the destination it should overshoot a bit and snap back

#

i wanted to achieve this using animation curve but they dont change anything

#
private void Update() {
  if (targetRotation != transform.rotation) {
    animationTimePosition += Time.deltaTime;
    transform.rotation = Quaternion.Slerp(startRot, targetRotation, RotCurve.Evaluate(animationTimePosition));
  }
  else {
    animationTimePosition = 0;
  }
}

where RotCurve is the animation curve from above

wraith turret
#

Yup clamping is default here

craggy bison
#

thank you this is exactly what i needed

#

works great