Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when generating terrain #1

Closed
Soahr opened this issue Dec 25, 2021 · 4 comments
Closed

Error when generating terrain #1

Soahr opened this issue Dec 25, 2021 · 4 comments

Comments

@Soahr
Copy link

Soahr commented Dec 25, 2021

Hi,

Thank you for sahring this stuff !
I got this error when i try to generate the terrain :
Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 6, VertexCount: 0 UnityEngine.Mesh:set_triangles (int[]) MeshData:CreateMesh () (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/MeshGenerator.cs:99) TerrainMapGenerator:CreateTerrain (single[,]) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:167) TerrainMapGenerator:CreateTerrainChunk (UnityEngine.Vector2,bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:138) TerrainMapGenerator:CreateChunkGrid (bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:118) TerrainMapGenerator:Generate (bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:88) TerrainMapEditor:OnInspectorGUI () (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/Editor/TerrainMapEditor.cs:37) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Do you have an idea about it ?

Thanks and have a good christmas day !

@aidan-clyens
Copy link
Owner

Hey! In the TerrainMapGenerator editor, could you please save the level file and attach it here? I'd like to see your terrain settings. Thanks!

@CyberZ3ro
Copy link

Having this same issue could you help me?

@arash28134
Copy link

I was having the same issue

Hi,

Thank you for sahring this stuff ! I got this error when i try to generate the terrain : Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 6, VertexCount: 0 UnityEngine.Mesh:set_triangles (int[]) MeshData:CreateMesh () (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/MeshGenerator.cs:99) TerrainMapGenerator:CreateTerrain (single[,]) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:167) TerrainMapGenerator:CreateTerrainChunk (UnityEngine.Vector2,bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:138) TerrainMapGenerator:CreateChunkGrid (bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:118) TerrainMapGenerator:Generate (bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:88) TerrainMapEditor:OnInspectorGUI () (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/Editor/TerrainMapEditor.cs:37) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Do you have an idea about it ?

Thanks and have a good christmas day !

I was having the same issue. that's most likely because your Chunk Width is set to 0 by default. try adjusting your terrain settings

@aidan-clyens
Copy link
Owner

I was having the same issue

Hi,
Thank you for sahring this stuff ! I got this error when i try to generate the terrain : Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 6, VertexCount: 0 UnityEngine.Mesh:set_triangles (int[]) MeshData:CreateMesh () (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/MeshGenerator.cs:99) TerrainMapGenerator:CreateTerrain (single[,]) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:167) TerrainMapGenerator:CreateTerrainChunk (UnityEngine.Vector2,bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:138) TerrainMapGenerator:CreateChunkGrid (bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:118) TerrainMapGenerator:Generate (bool) (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/TerrainMapGenerator.cs:88) TerrainMapEditor:OnInspectorGUI () (at Assets/Snow Scene/ProceduralTerrainGenerator/ProceduralTerrainGenerator/Editor/TerrainMapEditor.cs:37) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Do you have an idea about it ?
Thanks and have a good christmas day !

I was having the same issue. that's most likely because your Chunk Width is set to 0 by default. try adjusting your terrain settings

This is correct, thanks! I updated the project to not allow setting a chunk width of 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants