Closed YandanYang closed 1 year ago
This is expected behavior. Certain Unity functions are Editor Only
functions that only work from the Unity application while in edit mode, and cannot be executed at runtime from a build, which is why this is likely failing.
If you want to export a scene as an fbx, you will have to do something like use the Unity Editor itself to export a scene after selecting game objects. Take a look at the [Unity Documentation for this here.](https://docs.unity3d.com/Packages/com.unity.formats.fbx@2.0/manual/exporting.html#:~:text=Use%20Export%20To%20FBX%20(menu,to%20a%20single%20FBX%20file.)
Ok. Thanks for this.
Hi. I am trying to build a local unity3D with
invoke local_build
. I want to save export/save scene into .FBX/.obj files, so I add the following code in the file namedProceduralTools.cs
:but when I add
using UnityEditor
, the building process will fail. Some online materials sayusing UnityEditor
can only be used when we run the code in the Unity Editor but not the executable compiled version. Is this right? And is there any other way to export the scene into .FBX or .OBJ ? Thanks.