CFrame & Positioning Props inside of cardboard box

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    What I am going for is a script handles the math and auto-matically fills each box with products. By the size of the product (X & Z) and by the size of the box on both (X & Z) axis’ it comepletly fills the box up with product/merchandise.

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve been able to size the box to the amount of products I’d like inside by changing the Size.X and Size.Z to the Size.X/Z of the Monster Energy Can by multiplying number x

---what I mean,
local main = workspace.TestBox 
local maincan = main.Energ 
main.Size =*3,main.Size.Y,maincan.Size.Z * 3)

--- This works, but for when I want to clone the main can and properly position it no matter the CFrame, this is where I run into issues.

This technically works as written; however, 
I'd like it to position itself based upon the interior-bottom surface area of the box.
local main = workspace.TestBox 
local maincan = main.Energ 
local newcan = maincan:Clone() 
newcan.Parent = main 
newcan.CFrame = maincan.CFrame +,0,maincan.Size.Z)

Please let me know if you have any good solutions or math I can utilize as it would be of great help!

1 Like

Not sure exactly what the problem is, you say resizing the box works, but in the screenshot, the box looks too large for the 3x3 cans.

So is the size of the box the problem? or is it the placement of the cans that is the problem?