BunyaPineTree / LethalCompany_ModelReplacementSDK

A SDK to simplify creating character model replacements in Lethal Company
MIT License
5 stars 5 forks source link

InvalidOperationException: Sequence contains no elements #12

Open SAn4Es-TV opened 9 months ago

SAn4Es-TV commented 9 months ago

InvalidOperationException: Sequence contains no elements System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at :0) ModelReplacement.AvatarBodyUpdater.OffsetBuilder.GetBounds () (at ./Library/PackageCache/com.bunya.modelreplacementsdk@91ccd7f277/Plugins/OffsetBuilder.cs:222) ModelReplacement.AvatarBodyUpdater.OffsetBuilder.Initialize (System.Boolean force) (at ./Library/PackageCache/com.bunya.modelreplacementsdk@91ccd7f277/Plugins/OffsetBuilder.cs:193) ModelReplacement.AvatarBodyUpdater.OffsetBuilder.OnEnable () (at ./Library/PackageCache/com.bunya.modelreplacementsdk@91ccd7f277/Plugins/OffsetBuilder.cs:327) UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

BunyaPineTree commented 9 months ago

This error almost always means that you don't have any SkinnedMeshRenderers on your model.

All GetBounds() does is calculate the absolute extremity of the extremities of every SkinnedMeshRenderer on your model.

SAn4Es-TV commented 9 months ago

Okay, I added this element and now the game itself throws an error Снимок экрана 2024-02-16 235803

BunyaPineTree commented 9 months ago

The cause for skinnedmeshrenderers being missing is usually that your model isn't rigged. SkinnedMeshRenderers are automatically generated by unity on import for any model with bone weights on its mesh. If yours isn't generating a SkinnedMeshRenderer then you need to rig your model in blender, or sort it out via other means.

And while you can technically add a skinnedmeshrenderer yourself, it is almost guaranteed to not be configured correctly, hence the error.