How are you “correctly” supposed to disable a Collider? Collider.active is marked as deprecated, and it instructs you to use Collider.enabled instead, but that doesn’t exist…
Is this just some oversight by Unity?
How are you “correctly” supposed to disable a Collider? Collider.active is marked as deprecated, and it instructs you to use Collider.enabled instead, but that doesn’t exist…
Is this just some oversight by Unity?
If you want a collider that can be turned on and off, make a child object with the collider attached and use GameObject.active to enable/disable it.
Ok, that works.
So it was just an oversight? Should I submit a bug or is it a known issue?
This is what I do in some setups, and in others I enabled trigger, and in others I even Destroy(collider)
Although, I can see why architecturally it might make sense, .enable would be a better solution.
Well, that’s not really the issue here. It’s just that the documentation says that you’re supposed to use something that doesn’t exist. Of course, having an enabled property like every other component would be ideal, but that’s beside the point.
Wow!
Looking at the docs, and getting confused. Docs says something exists, but Unity begs to differ.
Then google and find this almost two year old thread, nailing this as a documentation bug, that has just been left ignored.
And then shrugging shoulders, realizing this is only symptomatic of Unity’s documentation.
Collider.enabled does exist, and it does work. That wasn’t always the case, but it is currently.
–Eric
Yes to be more specific it works now in 3.4.1f5, but it didn’t in 3.4.0f5
Thank you very much, I had already put it to good use!
Then a coworker running 3.4.0f5 told me that he got a compiler-error, and hence I revisited this thread, and saw the update.
There seems to be a regression bug here - Collider.enabled isn’t working for me again. Has the fix for the bug been accidentally removed between 3.4 and 3.5?
No regression, it works fine.
–Eric