lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.27k stars 778 forks source link

building custom vehicle asset bundle fails in Unity 2019.4.18f1 #1400

Open andreas-kustermann opened 3 years ago

andreas-kustermann commented 3 years ago

Hey LGSVL team,

I ve been working for a while now with the 2020.05 release, built custom map and vehicle in Unity 2019.3.3f1 following your documentation and youtube tutorial on this. After updating to the 2021.1 release, building the simulator from source and consequently working in Unity 2019.4.18f1 now I migrated my assets, manage to build the map but fail on the custom vehicle asset bundle with following error code in Unity when trying to start a build on this:

MissingReferenceException: The object of type 'BoxCollider' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. Simulator.Editor.FbxExportHelper.PrepareObject (UnityEngine.GameObject obj) (at Assets/Scripts/Editor/FbxExportHelper.cs:34) Simulator.Editor.Build+BundleData.PreparePrefabManifest (Simulator.Editor.Build+BundleData+Entry prefabEntry, System.String outputFolder, System.Collections.Generic.List`1[T] buildArtifacts, Simulator.Manifest manifest) (at Assets/Scripts/Editor/Build.cs:241) Simulator.Editor.Build+BundleData.RunBuild (System.String outputFolder) (at Assets/Scripts/Editor/Build.cs:519) Simulator.Editor.Build.BuildBundles (System.String outputFolder, System.Action onComplete) (at Assets/Scripts/Editor/Build.cs:1104) Simulator.Editor.Build+<>c__DisplayClass18_0.b__1 () (at Assets/Scripts/Editor/Build.cs:940) UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:322)

my vehicle has a few simple box colliders, also disabled them to see if it would be related, without effect, still same problem. Can you make sense of this? Any assistance appreciated - many thanks!

EricBoiseLGSVL commented 3 years ago

Don't use box collider in a vehicle, use a mesh collider. Look at Jag open source repo as an example. If you can screen shot the hierarchy in Unity it would help to debug.