Alrighty, so for some context:
I have a First Person Controller. It’s children are Graphics and Main Camera. The First Person Controller has an inactive script called Rain Creator on it. The game starts. I move into ‘Area1’ and that causes Rain Creator to turn on. Rain Creator makes a clone of a prefab in my Assets (Heavy Rain) and then makes it a child of First Person Controller. I leave ‘Area1’ and the Rain Creator script turns off, but Heavy Rain (Clone) is still a child of First Person Controller.
So I want to add to the Rain Creator script that when I leave ‘Area1’ the child object ‘Heavy Rain(Clone)’ is hidden so that when I walk back into ‘Area1’ it will unhide that same child object. I do NOT want to delete/destroy the child object, because if I do the Rain Creator script will not make another when it gets re-activated.
Is there a way for a ‘ForEach’ loop to only target one child object and then disable it? I think that’s what I need to do but I can’t figure out how. C# preferred but I could probably get javascript to work as well.
P.S. These suggested tags are terrible for this post >_>