- Home /
Procedural Geometry doesn't collide..
I must be missing something simple. This mesh is for a section of terrain and rigidbodies and raycasts just pass right through. How do I make this procedurally created mesh collide with stuff. (Yes, I am creating some of these with "addCollider" set to true.)
*EDIT: Whoa, what's going on with all the weird charachters when I paste code? It's freaking about tabs or something. Here's my code on pastebin. http://pastebin.com/SG0E26Ut
Does the object eventually get a mesh collider put on it? If so does it get a chance to recalculate after changes are made?
Edit: ah, thank you for the edit. Now I can see the collider.
I figured part of it out. I didn't realize I'd have to re-assign the shared mesh on the mesh collider after changing the geometry. It makes sense though.
it's procedurally created mesh? have you checked the tutorial on morten nobel's blog with some examples including colliders?
Okay, what part is missing now? Are raycasts still going through even though there's a mesh collider attached and up to date?
Answer by alpaca of zion · Sep 22, 2012 at 09:36 PM
http://docs.unity3d.com/Documentation/Components/class-MeshCollider.html
Take a look at that, particularly the first and second hint.