Script to random set active a child object?
Hi,
I want to create a script that every second randomises which child object is set to active and disables the rest. This is my current object heirarchy:
So lets say I want the "Tank" object to have a script on it so that when I enter playmode, it randomly sets a single child object (1,2,3,4,5) to active and makes the others inactive. Then after a second it repeats and chooses another random child object to set active and makes the rest inactive.
Can anyone help me out with this? I have very limited programming skills and need something like this desperately.
Many thanks,
Matt
Your answer
Follow this Question
Related Questions
UnityCar - Controlling Speed with a duration? 2 Answers
Move to next animation with clicking the game object 0 Answers
Image UI not enabling C# SOLVED 1 Answer
Object reference not set to instance for my timer and my text 0 Answers
Button appears when switching between scenes or quitting game 1 Answer