Hello! Again with my survival island game. Today i wanted to make sleeping regenerate all the island edible plants (dont judge me this wasnt meant to be realistic game anyways lol). I have 2 edible plants: red berry and coconuts. Both of them have their empty gameobject that they are bound to to not make a mess in hierarchy. Berries are one gameobject that are harvested as whole for berries, so calling GameObject.SetActiveRecursively on the gameobject containing berries, reactivates them as they are children of object that script activates (recursively
). Coconuts that you gather on other hand are children of palm, which is child of gameobject containing palms (phew) that i activate using my script. How do i activate sub children of the game object i am refering to?
I think i dont have to paste script here, because it theoretically works. Peace