b3agz / Code-A-Game-Like-Minecraft-In-Unity

Project files for a Youtube tutorial series on coding a game like Minecraft in Unity.
298 stars 237 forks source link

Generating 36 vertices instead of 24 #24

Open TeriyakiGod opened 2 years ago

TeriyakiGod commented 2 years ago

https://github.com/b3agz/Code-A-Game-Like-Minecraft-In-Unity/blob/81dfe22a4e5988fb5a4aded54bcc264cefecf67d/01-the-first-voxel/Assets/Scripts/Chunk.cs#L17-L29

This loop generates 6 vertices per face when it should be 4 vertices because 2 triangles on one cube face should share 2 vertices.