Hello, I have the following 2 values:
Vector3[] pos;
AnimationCurve curveY;
In the Start method I set 10 keys in the animation curve
Then in a for loop, I am trying to update update those keys with the new position
for(int i=0; i<complexity; i++){
curveY.keys[i].value = pos[i].y;
Debug.Log(curveY.keys[i].value +", "+ pos[i].y);
}
However, the debug shows the pos is constantly changing, but the curveY never changes! It always stays at the exact same value that was set in at the beginning.
I even tried this way but it doesn’t work either!
for(int i=0; i<complexity; i++){
curveY.keys[i] = new Keyframe(curveY.keys[i].time, pos[i].y);
Debug.Log(curveY.keys[i].value +", "+ pos[i].y);
}
Any ideas?