Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with setting a good position of a part?

local pmodel2 = pmodel:Clone()
pmodel2.Parent = script.Parent
pmodel2.CFrame = script.Parent.CFrame + Vector3.new(0, pmodel2.Size, 0)

So, each pmodel2 has a different size, so and script.Parent is a 1X1 brick. So when pmodel2 spawns, it is half way in the ground. I'm trying to get it to go up by its size so it looks like it's standing on the ground, rather than in the ground, but this doesn't seem to be working. Some help, please?

1 answer

✓ Accepted answer

You can simply do pmodel2.Size.Y/2 to get half the height of the part, by making the part this much higher it will appear to be standing on the ground. Your final code will be:

local pmodel2 = pmodel:Clone()
pmodel2.Parent = script.Parent
pmodel2.CFrame = script.Parent.CFrame + Vector3.new(0, pmodel2.Size.Y/2, 0)

This discussion is preserved as it was. New answers, comments, and votes are closed.