Am I using .SetActive too much?

I’ve just recently started using Unity after being fed up with 10 minute compiles in UE4. Having no C# experience and little to no C++ experience I have followed a Brackeys’ tutorial on making a simple 3D game. With that project completed I felt way more confident and so I decided to try to take on my own project, recreating the battle system of Pokemon Red. While I feel that I have learned a lot I’m really worried with the way I code. Most of my logic for when something is displayed or not is based off of enabling and disabling objects using stuff like .SetActive. So I want to ask you, is SetActive used alot or am I just so bad at programming? I’m feeling as if it was to be a crutch compensating for my lack of programming experience.

Sorry for my clunky English but I’m not native.

In 99% of situations it’s fine, then there’s this one dude who makes a complex object hierarchy flicker like mad every frame in Update.

It’s completely fine to call .SetActive() if you’re reasonable with it and you’re not doing generally idiotic things with it.

There are few caveats to toggling game objects like that though. The basic ones are that MonoBehaviour methods that are on the object or its children are not being run when the object is disabled, their coroutines are stopped and if it’s within a complex layout hierarchy (e.g.: HorizontalLayoutGroup - non-default kind of setting tho) the parent will resize itself and updates the whole tree.

The performance impact is non-existent for as long as your head is on your neck. Optimizations such as this are not in the group of “main concerns” - I’d actualy say that you won’t really find yourself optimizing it at all (I’ve been using unity for 5 years and this has never been an issue for me)