How to ensure raycasts hit colliders inside of trigger colliders on objects that have a rigidbody?
I have a gameobject that has two colliders (one trigger, one normal), and a rigidbody. I am seeing that a Raycast using QueryTriggerInteraction.Ignore
is ignoring hits on the gameobject sometimes. When removing the rigidbody the Raycast interaction behaves as expected with the normal collider generating a RaycastHit. I need for collisions to be detected on the normal collider on objects that have a rigidbody.
I have found that even in moving the trigger colliders to a child GameObject and setting the layer to "Ignore Raycast" causes raycasts to not collide. I was able to get this working by making the rigidbodies kinematic though this seems like it should not have any bearing.
Your answer
![](https://koobas.hobune.stream/wayback/20220613012000im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
AddExplosionForce not affecting every rigidbody 1 Answer
How to fix this problem? 1 Answer
PROBLEM: collision between two rigidbodies 3 Answers
Cube sinks partially into maze 0 Answers