i have this script and i have those errors, please heple
**** Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 2166, VertexCount: 400
- Mesh ‘DistortMesh’: abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(-nan(ind), -nan(ind), 0.00), max=(-nan(ind), -nan(ind), 0.00). Please make sure the mesh is exported without any errors.***
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MenuController : MonoBehaviour
{
//public string MainMenu;
public string AboutApp;
public string ARCamera;
public void MainMenuScene()
{
SceneManager.LoadScene("MainMenu");
}
public void AboutAppScene()
{
SceneManager.LoadScene(AboutApp);
}
public void ARCameraScene()
{
SceneManager.LoadScene(ARCamera);
}
public void QuitApps()
{
Application.Quit();
}
}
The first error means you have a triangle index in your triangle list that tries to reference a vertex that doesn’t exist. If your vertex count is 400, valid indices go from 0 up to 399. So most likely one of your “2166” indices are not in that range.
The second error means at least one of your vertices have invalid coordinates (NaN == Not a Number).
If the mesh in question was imported from an external source, the file is either corrupted or you try to import a format that Unity does not understand / support correctly. I’m not sure what the script you’ve posted has to do with the errors about one of your meshes…
Just by looking at the numbers the mesh in question seems to be a very strange mesh. Since the x and y coordinates of at least one vertex is NaN we can’t see how large the mesh is. However we can see that it has 0 depth so it seems to be a flat 2d mesh. What kind of meshes do you use? Are they generated procedurally or are they imported meshes? It’s impossible to give any further assistance with this issue with that little information. When do you actually get those errors? Just in Unity when you import a mesh? When you start your game (entering playmode)?