- Home /
Question by
Gregg Johnson · Aug 16, 2010 at 12:15 AM ·
guirandomimagesround
GUI Menu After every round how do I display a random image?
Hello!
I am making a game that has 1 minute rounds. When every round ends I want to display a random image from a bank of say 10 images. I am able to have an image displayed right now when the round screen pops up but I do not know how to randomize it.
Thanks in advance!
Comment
Answer by 3dDude · Aug 16, 2010 at 12:19 AM
you have to use a array like this :
var textures : Texture2D[];
function Start () { guiTexture.texture = textures[Random.value*texture.length]; }
Your answer
Follow this Question
Related Questions
how to add material component to an Animate GUI script 1 Answer
Same GUI script showing up in different places 0 Answers
Switch Between GUI images 0 Answers
Get variable from another object 1 Answer
disable code when level is rendered 1 Answer