In this article I will be writing about how to import DAE files in the Unity game-engine, more specifically DAE files obtained following the instructions in my guide “How to convert an OAR to DAE files”. For reference, the DAE files are created by a program from an OAR, the program handles such things as textures, mesh models, sizes and coordinates of objects from the OAR.
When you want to import the DAE files for standard Unity, you can use the Unity version you prefer. However if you want to use Unity to produce a Google Cardboard app you will need a specific version, we found success with “Unity 2018.3.14f1”. Other versions built the Android application without errors but didn’t properly respond to input on an actual Android phone.
Before you import the DAE files into your Unity project you should import a script SelectOARShader.cs into the Editor folder in the Asset directory of your project. The script comes with the OAR-converter tool in the folder Unity3D. To import the script, you just have to copy it in the right place, Unity will process the new script and show the progress with a green bar that fills up.
To import the DAE files you have to move the entire DAE-folder into the project’s asset folder. You will see a similar progress bar, just like when you copied the SelectOARShader.cs script. When the objects are imported you can select the objects in the DAE folder in your project and move them into the “Hierarchy view”, this imports them into your Unity scene. There may also be objects in the Phantom subfolder, depending on your converted OAR. These objects can be copied into the “Hierarchy view” by dragging and dropping as well.
Fixing transparent textures
Some textures with transparent parts may look foggy in the objects in the Hierarchy view. In other words some transparent textures may not be properly transparent. You have to follow the procedure for each object, that is not properly transparent. To fix this you have to click on the corresponding object in the asset folder, then select the material tab, go to Location and select “Use External Materials (Legacy)”. You can then go to the Hierarchy View, select the object, go to the shader and select a shader, that properly renders the transparency. One of these shaders is called Legacy Shaders/Transparent/Bumped Specular.
The next article will deal with importing the DAE files in Unity for Android Cardboard app development, I will provide some useful files and tips and tricks.
Opportunities for DAE files in Unity
The imported DAE files can be used for almost anything. You can use the objects for games, animations, VR apps and much more.