- Home /
setActive working only with some objects?
Hey guys,
I've come across such a funny problem: I'm trying to disable objects on mouse click using setActive(false). funny thing happens: some objects reacting to this, some not. with those which are not reacting to this method gameObject.renderer.enabled=false works.
Anyone came across such an irritating thing maybe? Anyone has a solution for that?
Thanks!
thanks for the answer @Harshad$$anonymous$$. SO far i'm sticking to Renderer.enabled, as it's working. I'm just more comfortable with SetActive() somehow;) I'll try to find the problem myself and if it wouldn't be possible I'll post code and other relevant stuff.
Thanks!
Answer by BilboStabbins · Dec 04, 2014 at 06:42 PM
This is because SetActive is used for Enabling/Disabling GameObjects. renderer is a component which is when you'd use .enable/disable = true/false. GameObject.SetActive
Your answer

Follow this Question
Related Questions
Why isn't inactive gameobject enabling itself? 3 Answers
SetActive is giving me a lot of issues 2 Answers
GameObject[] Issues 1 Answer
GameObject.SetActive not working in Coroutine? 1 Answer
physics.OverlapSphere colliders 1 Answer