I’m not a lot of an skilled, tried to search for for options however I by no means discovered any that I may use.
I’ve a guardian object, and I need to change it is baby objects randomly. That is the hierarcy:
I need to change each the “Roof” and the “Constructing” sprites randomly.
That is how my code appears like proper now:
public Sprite[] sprites;
void Replace()
{
RandomizeSprites();
}
public void RandomizeSprites()
{
random = Random.Vary(0, sprites.Size);
GetComponentInChildren<SpriteRenderer>().sprite = sprites[random];
}
This at the moment solely works for the primary baby object.
Can anybody assist me how you can do it for each?
Thanks upfront!