How can I make some parts to be Transform childs for another parts

So basically what I want I illustrated in the picture:

The default parenting seems to not do the thing. It makes kind of a new rotation center and so on.

2 Likes

It is kind of confusing on what your trying to achieve.

You can save the CFrame of the Child parts in relation to the ParentPart, and then when you change the Parent CFrame just apply the offset CFrame:

--Here is how you would do it
local Child = --put a reference to the child here
local Parent = --put a reference to the parent here
local OffsetCFrame = Parent.CFrame:Inverse() * Child.CFrame

--then when the parent cframe changes to update the Child's CFrame just do:
Child.CFrame = Parent.CFrame * OffsetCFrame
5 Likes

1 Like

You could set the Primary Parts CFrame.

Thanks. Btw, why does this not work at all:

local part = game.Workspace.Part
local part1 = game.Workspace.Part1
local part2 = game.Workspace.Part2

part1.Parent = part
part2.Parent = part

local TweenService = game:GetService("TweenService")


local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear)
local tweenGoal = {
	Orientation = part.Orientation + Vector3.new(0, 90, 0)
}
local tween = TweenService:Create(part, tweenInfo, tweenGoal)
tween:Play()

The parent tween’s its rotation and the child’s just stand still. When I parent manually in editor and rotate the parent it work.

Its very unclear with this solution, why is parent and why is child

Here I made a little example of how you can apply my solution in studio(The video recorder is a bit laggy)

Here is the studio file so you can see the script, to test it just toggle run mode and rotate the large part which is the “Parent” : OffsetDemo.rbxl (18.2 KB)

2 Likes

Work also with twining. Great.

3 Likes

I’ve downloaded that, and tested it. The child parts does not sync with the parent part, thus being said. This solution does not work in 2023. I’m having a similar issue but with a Carousel, only the parent part is spinning, wielding and weld constraints does not work either

OffsetDemo with Carousel.rbxl (69.4 KB)
This ^ Is what I mean