I have two lists, one with times and another with positions they look like this:
times: 0.02, 0.07, 1.32
positions: (0,0,0),(1,0,2),(2,0,3)
How would you go about moving a gameobject from position to position at the specific times?
Solution (Thanks to MikeNewall):
void Update () {
if(readyMove && step < logObjects.Count-1)
MoveObjects();
}
private void MoveObjects() {
if (logObjects[step].RecTime < Time.time-startTime) {
step++;
NextStep();
}
}
private void NextStep() {
logObj.transform.position = logObjects[step].Pos;
logObj.transform.eulerAngles = logObjects[step].Rot;
}