Hello, I have a simple level, and I want to set [.enabled = false] on all enemies’ collider and renderer components, but it seems to work at random.
I have a script in which I set up all colliders and renderers in two arrays:
and one where I tell the game to deactivate all enemy colliders + renderers as soon as the level is completed:
I use ‘‘i + 4’’ because one 3d object is imported from Blender and is made of several smaller 3d objects.
The setup in Unity:
When I test it all, the game will sometimes deactivate that collider but not this renderer, sometimes it’ll deactivate both on one object and it’s the big surprise for others. Why is it inconsistent ? And how can I fix this ? I would really appreciate your help !