How do you put a part on top of another custom Size part?

How exactly can I fit it because the size and position of the part is different
image
image
Example:
image
or
image

local a = game.Workspace.Partt_ local b = game.Workspace.Partt local c = game.Workspace.Part
a.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
b.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
c.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
a.Position = c.Position + Vector3.new(0,???,0)
b.Position = a.Position + Vector3.new(0,???,0)
...

(I don’t want to put it with a certain amount of numbers, it must have some logic)

1 Like
local a = game.Workspace.Partt_ local b = game.Workspace.Partt local c = game.Workspace.Part
a.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
b.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
c.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
a.Position = c.Position + Vector3.new(0,-c.Size.Y,0)
b.Position = a.Position + Vector3.new(0,-b.Size.Y,0)

Dont Working And I wanted to put it on top not underneath
PARTS’ SİZE NOT SAME

image

If you want to go up, not down just simple change the negative to Positivie, but I did forget something…

local a = game.Workspace.Partt_ local b = game.Workspace.Partt local c = game.Workspace.Part
a.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
b.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
c.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
a.Position = c.Position + Vector3.new(0,c.Size.Y+a.Size.Y,0)
b.Position = a.Position + Vector3.new(0,b.Size.Y+a.Size.Y,0)

I didn’t add in the current part’s size to the positional value, try this, I’ve also changed it to positive so it should go up not down

image

ahh yes of course, okay so last thing…

local a = game.Workspace.Partt_ local b = game.Workspace.Partt local c = game.Workspace.Part
a.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
b.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
c.Size = Vector3.new(math.random(1,1000),math.random(1,1000),math.random(1,1000))
a.Position = c.Position + Vector3.new(0,c.Size.Y/2+a.Size.Y/2,0)
b.Position = a.Position + Vector3.new(0,b.Size.Y/2+a.Size.Y/2,0)

So what I missed there was that when we use size, it’s the whole size, but we only want to adjust by 1/2 of that in this case. Just went ahead and threw this on my studio to verify there shouldn’t be any other issues XD Sorry bout that :slight_smile:

2 Likes