- Home /
Trouble with mesh colliders
Hello everyone,
I need to detect collision/trigger with 2 mesh colliders and making them convex does not work for me.
I have a wire and a loop, the user has to guide the loop through the path/circuit of the wire without touching it. check the attatched picture.][2]
First problem is that, I am obliged to use mesh collider for both, (the path gets more curly and its not a solution to use many primitive colliders)
since collision is detected bwtween 2 mesh colliders, only it they are convex.
Making them convex results in a collider just like a box collider, check the second picture , (the red part is a separate mesh and has the collider attatched). In this case I am stuck, can't detect dollision? Then I came up with an idea of adding child primitive colliders to the loop (the grey donut) since it was simpler and easier than adding to the circuit! check the third picture , I am not sure if this is the right way to do because it sucks, if I had the loop an another shape (like heart or start), will I make 50 shpere colliders to make up a star?
Waiting for hints :)
[2]: /storage/temp/13638-untitled-2.jpg
Answer by SanX91 · Jul 31, 2013 at 03:46 AM
How about a very simple solution like this :-
Instead of attaching so many colliders.. just add one sphere collider within the empty space of the donut.. Then check your conditions on collision exit or trigger exit... I mean most of the times the wire would be inside the collider.. But on exit, it actually touches the ring.. GameOver.. On collision exit or trigger exit, just stop the movement, so that it does not pass through the mesh... I believe it might just work....
Thumbs up, Sounds a good solution.. the only confusing part to me is when the user pulls the loop(donut) it will appear like being pulled but never get out of track, so rotation will be changed but only movement has to be stopped. I will give it a try and reply back.. I liked the trigger exit idea!
Your answer
Follow this Question
Related Questions
How to add to a 3D object's length through code? 1 Answer
Overlap point of 2 kinematic colliders 1 Answer
How to add the right amount of points when my player destroys a gameobject? 0 Answers
Receiving information about getting hit by a Raycast 2 Answers
How do you execute Trigger-collider collision only in one gameobject? 1 Answer