Problem using Lerp inside a For loop

Hi guys!
I’m doing some Technical Artist exercises. I’m trying to recreate what caught my attention in the new game state video of Hogwarts Legacy.

I’m trying to re-build objects that are already fractured-> I have 1 gameobject “Broken_bridge”, and inside of this one, there are the broken pieces (lots of game objects).
I use Bezier curves, so every broken piece has a trajectory with 50 points (Vector3), and I want to do a Lerp for all the fractured gameobjects.

The problem is that when I hit play, I only can see the ending of the Lerp movement. All the fractured pieces are almost in the final place… But I want them to follow my Bezier curve.
This for loop should work. But I don’t know what’s wrong with using Lerps in a For loop. Help please.

void Update()
    {
        DrawAllMovementCurves();

        //Move broken meshes (create function later)

        //float distCovered = (Time.time - startTime) * speed;

        for (int i = 0 ; i < instantiatedBrokenMeshes.Count ; i++)
        {
            float distCovered = (Time.time - startTime) * speed;
            float fractionOfJourney = distCovered / journeyLenghtList[i];

            for (int j = 0; j < 49; j++)
            {
                instantiatedBrokenMeshes[i].transform.position = Vector3.Lerp(myCurves[i].positions[j], myCurves[i].positions[j + 1], fractionOfJourney);
                instantiatedBrokenMeshes[i].transform.rotation = rotationsFromBrokenMeshes[i];
            }
        }
    }

If you want to see them move, then you have to spread the movement out over multiple frames. You’re currently doing all of the movement in a single frame.

Anytime you run a loop, your code will enter the loop, run the loop until it exits, and then continue to run code till it has a reason to stop.

In your case, when it exits the loop, Update ends and then the main thread can do visual stuff for you. If you want to have it do stuff visually during the for loop, you’ll need to use a coroutine and have it wait during each iteration of the for loop. Or, you can set up something in Update to wait and only execute code every so often vs using a loop. But the coroutine might be easier to do.