For Loop not working as intended in Start() but does in Update()?,For Loop in Start not Behaving as Expected?,

I am a bit confused as to why this for loop isn’t behaving as I would expect it to when I call my method in start, though it behaves as expected when calling it from void Update(). Essentially I want it to display a different shape onto game screen with each pass of the for loop. Though this isn’t what I am observing. It statically shows one shape. Though when I call the same method in Update() I see the behavior I’m looking for more or less. Any help is very appreciated!`using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{

[SerializeField] Sprite[] Shapes;
[SerializeField] SpriteRenderer spriteRenderer;
int randomShape;

// Start is called before the first frame update
void Start()
{
    PickShape();
    
  
}



public void PickShape()
{
    for (int i = 0; i < 10; i++)
    {

        randomShape = Random.Range(1, Shapes.Length + 1);
        spriteRenderer.sprite = Shapes[randomShape - 1];
    }
    

}`

,

Start runs in its entirety before the first frame is displayed. That means the loop goes all the way through, picking as many random sprites as there are in the array. However none of them are displayed because the first frame only happens after the entire loop has completed. You are randomly selecting many sprites but only the last one to be chosen is displayed, after Start has run to its completion.

Update is doing the same thing. It is running through the entire loop and only displaying the last sprite selected. The difference is that, having displayed that sprite, the loop starts again. You are seeing different sprites appear in update not because of your loop but because of update. You might as well not have the loop at all…

This can be fixed with Coroutines but rather than write an example now, I thought I’d check. Do you really want to display 1 sprite per frame? You would barely see what was happening, the images would go so quickly - it would be a blur. Do you want to display them more slowly, as if they were animated?