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:

01for x = 1, 12 do
02    for z = 1,12 do
03        local s = script.Cell
04        local prevC
05        local cs = s:Clone()
06        cs.Parent = h.Slots
07        cs:SetPrimaryPartCFrame(CFrame.new(x*8,z*8,0))
08        cs.Name = v1.CName(x,z)
09    end
10end

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