|
I am setting up a system where I click an object to enable another object, then I can click another object to disable both those objects...etc. My problem is that the objects are prefabs. If I destroy it, I cannot access it to instantiate it again, and I cannot set prefab.active to simply disable it instead of destroying it. The code is spread across multiple classes so I can't just paste it, but code should not be needed. I simply need to know how to add a reference to the object I want to enable and disable (it is a prefab I drag and drop on the script as a game object) without destroying it to disable it. Hope that makes sense, I can try explaining another way if needed.
(comments are locked)
|
|
You shouldn't be disabling the prefab itself. Try instantiating a 'prototype' object in Awake or something, somewhere far away from where the action occurs (9999,99999,9999 or something), and then using that like you would use a prefab. This way, you don't have to worry about modifying the prefab, and you can make all the changes you like before duplicating it.
(comments are locked)
|
