I have this problem where the most practical and optimized way of aproaching this problem seems to be playing with the SetActive method.
Each time you talk to a NPC a small window rendering a camera will pop up in the UI, where a copy of all NPCs are, all deactivated and activate on speak with the according npc, and deactivate on ending the dialogue.
The problem is, that when a Object is disabled, as far as I understand, the code and the engine won’t be able to find it and interact with it.
Is there any other way around? I’d love to make this way work so the game doesn’t have to process all the copies of the NPCs all the time.
I also tried doing it with the meshrenderer component, but It doesn’t seem as good as an idea not only because of performance but also because the NPCs might have diferent mesh renderers at the same time.
Any tips about the SetActive method or any idea how should I do this? thanks in advance