Skip to main content

AnimationCurve.Evaluate not working

This issue is likely due to the AnimationCurve being set to Loop wrap mode, which is currently not supported by the Unity Playworks Plugin. Consequently, AnimationCurve.Evaluate() will be a value that always increments. To simulate the loop this value should decrement too.

Possible solution:

  • Set the wrap mode to Default, then add the decrement logic for the curve evaluation in your code:

    float val = (Time.deltaTime / 8) * AnimationSpeedReduction;
    ShinyLightCurveTime += _increment ? val : val * -1;

    if (ShinyLightCurveTime >= 1f)
    {
    _increment = false;
    } else if (ShinyLightCurveTime <= 0f)
    {
    _increment = true;
    }