- Home /
OnTrigger problems
So i have:
A camera with a sphere collider and it isTrigger with no rigidbody
A block with a box collider that is not trigger and it has a rigidbody on it
A script on the camera which is
void OnTriggerStay(Collider other) {
Debug.Log ("collision stay");
}
Why is this not working? Any help is welcomed!
Answer by Kaivo · Jun 30, 2013 at 05:43 PM
See the table at the bottom of this page. It displays what is trigger when which kind of object hits which other kind. http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html
Answer by aldonaletto · Jun 30, 2013 at 05:45 PM
Well, the question isn't clear enough, but I suppose that you're moving the camera into the block and expecting trigger events. If this is the case, add a kinematic rigidbody to the trigger: a static trigger can detect rigidbodies or CharacteControllers that enter it, but a moving trigger must have its own rigidbody - usually with Is Kinematic set, what avoids unwanted reactions to gravity and collisions.
Even with a kinematic rigidbody on the camera, when it clips through the wall and is inside the box collider, the OnTriggerStay still does not send me the debug message
Your answer
![](https://koobas.hobune.stream/wayback/20220613105213im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Weirdest Collision EVER 1 Answer
How to check if an object is colliding with another from another script ? 1 Answer
Distribute terrain in zones 3 Answers
A node in a childnode? 1 Answer
Multiple collisions not working.Plz help 0 Answers