ModExtraAssets is no longer getting updated for classic. However, since 2024 there's a MEA Revamped version that fits BepInEx moddding BB+ perfectly!
Download tool mentioned in the references above
Load and then convert your .obj to .mea
Put .mea in ModExtraAssets for example (ModExtraAssets/Mesh)
Load all meshes to data database by FindAllDBLoad in the references
Example how to use that loaded mesh
using System;
using UnityEngine;
public class Example : MonoBehaviour
{
private void Start()
{
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
gameObject.transform.position = new Vector3(0f, 2f, 0f);
gameObject.GetComponent<MeshFilter>().mesh = ModExtraAssets.Get<Mesh>("MyMesh");
gameObject.GetComponent<MeshRenderer>().sharedMaterials = new Material[]
{
ModExtraAssets.Get<Material>("MyMat1"),
ModExtraAssets.Get<Material>("MyMat2"),
ModExtraAssets.Get<Material>("MyMat3")
};
}
}
Try adjusting the scale of a GameObject, sometimes unity can export models and make them big
Example:gameObject.transform.localScale /= 100f;Also check if the name of model is right and stuff
This can occur on high-poly meshes, and idk how to solve that, as it's not my loading meshes tool is not made by me (Go to credits)
Textures are not loading along with the mesh, but you still texture them by script, as far as i know the mesh saver saves UVs in order as well
Example of using multiple materials:gameObject.GetComponent<MeshRenderer>().sharedMaterials = new Material[]
{
ModExtraAssets.Get<Material>("MyMat1"),
ModExtraAssets.Get<Material>("MyMat2"),
ModExtraAssets.Get<Material>("MyMat3")
};
Keep in mind that you should apply materials in order, if your mesh has more that 1 textures