Collider issues when exporting from Unity to DCL

Hi all,

I’m new to the DCL community but I’m an architect with quite a bit of 3D modeling experience and a huge interest in game and digital content design.

Unfortunately for me, the industry software for architects aren’t the best best for game development (Rhino 3D, Sketchup, Revit, etc…). I was introduced to Unity in school and have become familiar with coding in Unity and modeling with Probuilder and Polybrush. To me, of the programs that I know well, Unity seems to be the best alternative to Blender or 3DS Max since the gameobject/scene framework seem to be built similarly to DCL.

I’ve been messing with prototyping some simple scenes and exporting them to the DCL SDK (using the Fairwood DecentralandUnityPlugin) or even just creating a model and exporting it as a glTF (using the Plattar Unity-glTF-Exporter) and importing it to the in-browser builder but it seems whatever I export from Unity will either not appear at all due to mesh renderer/texturing issues and/or they’ll appear perfect but won’t have colliders. The texturing issue seems a bit easier to troubleshoot since I’ve been able to pull in a few of my meshes with correct texturing. The collider issue however, is persistent with any object I bring in from Unity.

I did find the DCL guide about adding colliders prior to exporting by adding the “_collider” suffix. I’ve tried that by naming the gameobject itself with the “_collider” suffix, creating a child gameobject with just a collider and the “_collider” suffix or duplicating the object as a dummy with the “_collider” suffix and exporting them separately but nothing seems to work for custom built meshes. I say custom built meshes because the one thing that did seem to work was the Fairwood plugin has “DCL Object” primitive prefabs that render and collide correctly when you preview a scene, but nothing else will. Even the custom meshes in their example scene don’t appear or collide correctly which I assume is due to changes in the Unity/DCL builds since they developed their plugin. Even when I edit one of their “DCL Object” primitives using Probuilder to make some wonky shape, it still renders in the DCL SDK as the original cylinder/cube/sphere that it was created as since it has a “DCL Cube” or “DCL Cylinder” script attached. The Plattar plugin exports any mesh perfectly but no matter what collider I add (mesh/box/capsule), no collision is registered in the scene.

The only idea I have left, short of delving into the code which I’m not so sure I could troubleshoot such a high level issue, is to add a ton of their “DCL Cube” objects, remove the mesh renderers and approximate my object’s walls but that seems like an ass-backwards way of doing it, especially since I’d have to adjust all the colliders by hand when Unity’s colliders approximate the size/location for you. I’m also not certain that it would work the way I think it would and would likely add a fair number of extra triangles.

My question is, are there any official plugins or tools for Unity that work well with DCL. Whether it’s exporting glTFs or Glbs, or exporting entire scenes to the SDK? It seems that there’s a ton of resources out there for this but all of them were built for the 2018 build of Unity or earlier and no longer work or work incorrectly. If there is nothing official, is there any documentation for working through issues like this that anyone has found?

Sorry for the long post and any help with this issue is greatly appreciated, it’s very frustrating.

I’ve had a few problems like this with Blender as well…
Sometimes a .GLB works with the _collider but the .GLTF doesn’t…
This kinda question would get answered quicker and more professionally in the discord!

1 Like

Thanks for the feedback, might be good to add them just to get advice in the future.

For Unity, I got the Plattar plugin to work but not the Fairwood scene exporter. The kicker is that I have to create a copy of my gameobject and use ProBuilder’s “Set Collider” tool which adds a collider script to the object separate from the Unity default colliders. Plattar’s plugin also packages and exports the object with all of the textures, materials and animations which is nice but I have to build each object separately in Unity, export to the builder, assemble the scene and re-export. With the Fairwood plugin you’re supposed to be able to build, assemble and code the scene in Unity and export a fully working scene. Oh well, as long as it works.

I honestly think it was an issue with naming. In the DCL documentation it says that some programs will add numbers to the end of objects to avoid naming issues, so model_collider 1, model_collider 2, etc… That may jack up your build.

You tried importing your model into blender then exporting again?
I’ve never used unity personally…

1 Like

Unfortunately the only time I’ve used Blender was back in 2005 or so. I used Rhino to build some models and tried a Sketchup model but they’re not great due to optimization issues, plus they still have the same issues. I’m just building simple low poly models within Unity now which works pretty well aside from the exporting issues. I really should get into Blender again, way more versatile than all the 3d modeling programs I use.

It would only take 10 minutes to download blender and ‘file > import’ your .gltf then ‘file > export’ your model again… Will also show you if the _collider is correct in the top right…

I might have to check that out to ease my workflow. I got colliders to work when exporting from Unity but I can’t export the whole scene like I thought I’d be able to with the one plugin.