I want to change the UI image in random order. I have a gameobject in UI(canvas) containing Image component and it has nul
Use overrideSprite field instead of sprite - documentation
overrideSprite
sprite
Unfortunately, unity ui is full of such pitfalls and it's api is totally counter-intuitive, so you have to be careful and check the docs regularly