Converting Parts into Terrain?

Hey there! so, i’m trying to make an inf terrain generation and found this video: Terrain Generation 2 - Roblox Studio (Chunk Objects and Triangles) - YouTube by @okeanskiy

i tried to test npc’s at the generation by searching up “nico nextbots” at the model and inserting it and it just bugs out. Maybe because it is made of triangles/wedges entirely?

I tried terrain and npcs worked (terrain in separate game to test if its just npc or the inf terrain) so how would i effectively convert the wedges into terrain?

Thanks!

4 Likes

I’m sorry, are you referring to turning parts into terrain?

3 Likes

Use this Roblox plugin, This is 100% safe and has no virus. This has over 1k likes…

3 Likes

Ah, but theres a problem with that. Its a plugin and not a script/module script.

1 Like

Yeah chaaaaaaaaaaaaaaaaaaaaaaaaaars

1 Like

Did you mean to turn a part to terrain from a script?

3 Likes

Refers to Fill… functions within this page
FillBall, FillBlock, FillCylinder, FillRegion, FillWedge
Terrain (developer.roblox.com)

4 Likes

Doesn’t work, i made a function and it loops through all the wedges, then it tries to use “FillBlock” (i even tried “FillWedge”) to make it grass and it just didn’t work.

1 Like

Can you show the code that this’s used?

2 Likes

Dont have the code rn since i deleted but i remember it.

local function convert(chunk)
       local instances = chunk.instances

       for i,v in pairs(instances) do
              if v.Name == "Wedge" then
                     workspace.Terrain:FillBlock(v.CFrame,v.Size,Enum.Material.Grass)
                    v:Destroy()
                    table.remove(instances,i)
              end
       end
end

Idk if the table.remove thing worked but whatever

2 Likes

You don’t need table.remove for this

2 Likes

original code didn’t have it, it still didn’t work sadly :frowning:

Are you sure instances is an array of part already?

1 Like

Yeah, instances are an array of parts, also i checked if its named “Wedges” since trees are also stored there.

The string you specified is “Wedge” though

1 Like

I didnt rename the Wedges, idk why i put it in quotation

Its still named “Wedge”

Can you try print(instances) before the for loop and screenshot the output table expanded?

1 Like

Studio crashed but whatever

Also ill show u what it looks like
received_484245646867171

It literally just makes no parts at all when i remove “table.remove”

I printed v.CFrame and v.Size

--CFrame \/--
772.5, -16.9695091, 765, -0.17906189, 0.684085429, 0.707081199, 0.969490528, 0.244981378, 0.00850054342, -0.167406663, 0.687030613, -0.707081199
--Size \/--
0.0010000000474974513, 10.939990997314453, 10.629768371582031

It is a possibility that the thickness of these are a bit too small for an actual terrain to be made

Try set the X axis size to 1 to see if it works

1 Like

OOH I’VE DONE THIS BEFORE lemme see if I can find the code…

1 Like