- Home /
Unity 5 - Raycasting to Mesh Collider with parent Rigidbody
I'm converting my project to unity 5 and i'm stumped on how to solve this problem. Im trying to Raycast to a child meshcollider of a rigidbody. The mesh collider is a Voxel mesh so it is concave at times and cant be converted to a convex mesh collider. This mesh collider is only used for raycasting.
When the parent object has a rigidbody, raycasts seem to stop triggering. I get the error: "Non-convex MeshColliders with non-kinematic Rigidbodies are no longer supported in Unity 5.0."
Hierarchy
LayerMasks
Parent Rigidbody - Default
Child MeshCollider - Raycast
Child ConvexMeshCollider - IgnoreRaycast
Answer by Fueltr · Mar 11, 2015 at 10:15 AM
Solution FOUND!!! :)))
LayerMasks
Parent Rigidbody - Default
Kinematic Rigidbody - Raycast
Child MeshCollider - Raycast
Child ConvexMeshCollider - IgnoreRaycast
Creating a child Kinematic Rigidbody to the normal Parent Rigidbody, then childing the MeshColliders to it allowed me to raycast to the colliders again.
Im not sure what was happening before. My guess is that there is some internal grouping of colliders that Unity creates when it the rigidbody collects all the child's colliders and if a collider fails the test(Non Convex MeshCollider) then they don't get registered.
Your answer
![](https://koobas.hobune.stream/wayback/20220613185651im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Graphical glitch after updating to Unity5. 0 Answers
Unity 5 GUI crashes android 2 Answers
Non convex Trigger - Unity5 limitation 2 Answers
Unity 5 Polygon Collider Add Vertices 1 Answer
Unity 5 complains "Failed to load font from memory" 0 Answers