yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 14 Jul 2016 03:57 PM |
Who posts his whole script, but here is quite a chunk of my map gen script (please don't roast me about it since i just made it today)
local vertex = Instance.new("Part") vertex.Size = Vector3.new(1, 1, 1) vertex.Anchored = true
local verticies = {}
local width,height,length = 10,10,10
function generateTerrain() for i = 0, width do for ii = 0, length - 1 do local y = math.random(10) vertex:Clone().Parent = game.Workspace.Verticies vertex.Position = Vector3.new(i*10, y, ii*10) vertex.Name = i .. ii if i == width then vertex.Name = "z" .. i .. ii end end end verticies = game.Workspace.Verticies:GetChildren() game.Workspace.Verticies.Part:Destroy() for i, v in pairs (verticies) do if not string.match(verticies[i].Name, "9") or not string.match(verticies[i].Name, "0") then drawTriangle(v.Position, verticies[i+1].Position,verticies[i+11].Position, game.Workspace) drawTriangle(verticies[i+1].Position, verticies[i+11].Position,verticies[i+12].Position, game.Workspace) end end end
It works fine but on the ends of rows ( block 09, 19, 29, 39 etc) it tries to attatch it to the next row which creates a stretched triangle and looks dodgy. I've tried to remove this affect but it just doesn't go away :( Please help. |
|
|
| Report Abuse |
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 14 Jul 2016 04:01 PM |
| A gold star to whoever can help |
|
|
| Report Abuse |
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 14 Jul 2016 04:11 PM |
| Please looking for some guidance i have absolutely no idea why these big triangles appear, i have tried so hard. |
|
|
| Report Abuse |
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
| |
Ryuzoji
|
  |
| Joined: 21 Dec 2015 |
| Total Posts: 937 |
|
| |