I’ve already made a script that sets a model’s position on top of a basepart.
But the problem is, I can’t find a way to set the model’s position on top while not setting
the model’s position to the center.
Current code:
local floorY = workspace.Baseplate.Size.Y/2;
local modelY = workspace.ShadowFigure:GetExtentsSize().Y/2;
local Yposition = floorY + modelY;
local diff = workspace.ShadowFigure:GetBoundingBox().p - workspace.ShadowFigure.PrimaryPart.Position
workspace.ShadowFigure:PivotTo(CFrame.new(workspace.Baseplate.Position + Vector3.new(0,Yposition,0)) - diff);
To make it more clear, This is what I want to happen:
It’s likely doing that because the value of Position is the center of the part.
Instead of using workspace.Baseplate.Position in your PivotTo, maybe try making your own Vector3, with the X and the Z being your ShadowFigure’s PrimaryPart’s position (So the model stays in place), and the Y being the Baseplate’s position
You can CFrame the Position of A at the vertical height of B + 1/2 the vertical height of A.
Or B’s Position + 1/2 the height of B + 1/2 the height of A.