Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How to generate hexagon cells ?

Asked by 4 years ago
Edited 4 years ago

Hello! So, i'm trying to make something like a bee hive generation, but thoose cells are just generated in line, but i want them to fit all the space. Here's my code:

    for x = 1, 12 do
        for z = 1,12 do
            local s = script.Cell
            local prevC
            local cs = s:Clone()
            cs.Parent = h.Slots 
            cs:SetPrimaryPartCFrame(CFrame.new(x*8,z*8,0))
            cs.Name = v1.CName(x,z)
        end
    end

Here's also a screenshot of my result: https://imgur.com/a/SDSZBug

0
so, the same thig made in bee swarm simulator, for reference, but i still can't get how GravityGouse99938 75 — 4y
0
Gravity , Ive done something Like this Before , but With UI's. the same can be done with objects. Wuuld you like it set up exactly like the reference picture? Tizzel40 243 — 4y
0
Because It is just Math and Logic. Tizzel40 243 — 4y

Answer this question