- Home /
Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 2166, VertexCount: 400
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();
}
}
Answer by Bunny83 · May 29, 2019 at 11:56 PM
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)?
hi, thank you for your reply, but i don't know what does mashes mean , i just follow a tutorial on youtube, i'm really nobe.
Sorry but you still haven't added any useful information about your issues. Did you import some kind of model into your project? We do not own magic crystal balls to deter$$anonymous$$e what assets you might use and what might be wrong in your project.
If you have absolute no background in game development you should start actually looking up some concepts and terms. If you haven't heard of a mesh (more specifically a triangle mesh) how did you actually end up in game development in the first place. That's like a nuclear physicist that is suprised to hear about nuclear fission and radio active material.
Game development / program$$anonymous$$g is all about problem solving. You're faced with a certain task, you identify the requirements / issues you have and try to find a solution for your problems. That's what developers do on a daily basis. That's development. You have to invest some time learning the absolute basics about games if you want to develop games.