I’m trying to figure out how this could possibly work:
for (var key = startKeyIndex; key < keys.length; key++) {
var endKey = keys[key + 1];
if (endKey.frame >= currentFrame) { <<<<<<<<<<<<<<<<<<<
state.key = key;
var startKey = keys[key];
var startValue = this._getKeyValue(startKey.value);
if (startKey.interpolation === AnimationKeyInterpolation.STEP) {
return startValue;
}
This seems like key + 1 will always go out of bounds. Changing the statement to “keys < keys.length - 1” definitely improves it.