Did I map this out good visually?

Im trying to understanding how to make a pet grid system, so I decided to map it out visually for more understanding.

Did I do the steps correctly showed in the script showed below the picture?

Script I used as reference:

local row_count = 4;
local spacing = 2;
local start = -(row_count/2)*spacing;
local x_off = start;
local z_off = 5;
local count = 0;

for _, pet in pairs(pets) do

	if count > 0 and count%row_count == 0 then

		z_off += spacing;
		x_off = start;

	end

	-- use x_off and z_off in BodyPosition.Position

	x_off += spacing;
	count += 1;
	
end
4 Likes

I just re-read this again after a day of rest, and I think I partially figured it out.

Didn’t see this notify! Great visual by the way, i certainly didn’t check it as rigorously as that, great stuff but you didn’t add x_off every pass. I hope it worked for you even in a small way. Seemed to work for most numbers I tried (I’m sure boundary conditions will chop it’s leg off at some point), and after all, it was just a leg-up and nothing definitive or complete.

1 Like