Ok so. This is some wonky so I’ll try hard to explain it simply.
- You have a GameObject with a script called CastScript and a MeshCollider
- If you raycast from the CastScript it will find the MeshCollider on the GameObject that it is attached to
- If you then do a MeshCollider.enabled = false and raycast from the CastScript, it will no longer find that MeshCollider on the same Gameobject
Now, all that is expected.
This is where its driving me crazy.
- You have a GameObject with a CastScript on it
- As a child of GameObject you have ChildGameObject, on ChildGameObject is a MeshCollider
- Now you if you ray cast from CastScript it will find MeshCollider
- if you then do MeshCollider.enabled = false, then raycast from the CastScript it will still find MeshCollider on ChildGameObject
Why is it that if you Raycast from a script, it will find the MeshColliders on the children of that scripts GameObject even if those MeshColliders are not enabled?
Is this a bug? Or is this intended and I’m missing something?