I'm building collision around my render geometry using mostly Cube game objects. In order to work with them easily in the editor (I'm using Unity 1.5 for iPhone), I have the Mesh Renderer for each one enabled so I can see them. But when in the engine, I only want them to collide but not render.
I've thought of writing a script that turns off rendering for all objects tagged "collide", but that feels a bit clunky to me and might give me a little hiccup as the level loads (just guessing). Has anyone come up with a good workflow for working with visible collision in the editor but have it invisible in the game?
asked Dec 10 '09 at 07:35 PM
Put all of the collision geometry on a separate layer, go to your Camera, where it says Culling mask, click on Everything and uncheck the layer that your collision geometry is on.
answered Dec 10 '09 at 10:12 PM
I've taken to designing my colliders in Blender, using meshes, and converting the meshes to colliders upon import. This is part of a larger scheme, in which I do all my level editing externally, and then sync with FBX files.
It's kind of like this, only it allows for mesh editing instead of just scaling a unit primitive. (This example doesn't really provide support for capsule colliders, but mine works fine with those.)
Let me know if you're interested. I'm going to release my solution to the wiki after I finish putting it through its paces on my current game. I'm still adding features and cleaning it up, but it does work.
answered Dec 11 '09 at 02:18 AM