CFrame of the welded object does not change when it is inside ServerStorage

Reproduction Steps
Run this: CFrame.rbxl (26.6 KB)

Expected Behavior
The welded object’s CFrame should be changed in the same way both when it is inside ServerStorage and when it is in Workspace.

Actual Behavior
CFrame of the welded object is only changed when it is inside the Workspace.

I created an identical copy of the same structure in both ServerStorage and Workspace:

image

This is script is in ServerScriptService:

local function ChangeCFrame(Part)
	local p1 = Part
	local p2 = p1.p2
	local p3 = p2.p3
	p2.WeldConstraint.Enabled = false
	print("before:",p3.CFrame)
	p2.CFrame = CFrame.new(10, 10, 10)
	print("after-:", p3.CFrame)
end

print('---workspace---')
ChangeCFrame(game.Workspace.p1)
print('---ServerStorage---')
ChangeCFrame(game.ServerStorage.p1)

When you run, you’ll notice that p3.CFrame (the last welded child) will not change for the server copy:

image

Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Constantly

2 Likes

The DevHub identifies this as the expected behavior, and it’s observable with WeldConstraint.Active.

If the WeldConstraint or one of its parts is not in Workspace the weld will be inactive.

2 Likes

This is expected behaviour as @Kabutey said.

I was building a ladder dynamically within the ServerStorage, doubling step by step to make this object available to be cloned into the workspace only when necessary.
Does this mean that it is not possible to build a tree of welded objects inside ServerStorage?

If you want the parts in ServerStorage to have physical behaviors like that then you need to put them inside of a WorldModel within ServerStorage (Or anywhere else, there’s no restrictions on where a WorldModel has to live).

The WorldModel acts like a mini isolated Workspace of its own. Any parts you put in it will respect the welds and other joints like you expect them to and you’ll be able to call Raycast, FindPartsInRegion3 etc on the WorldModel to do geometry queries against the parts in it. This of course comes with a non-trivial overhead, which is why it isn’t the default behavior and you have to opt into it by using a WorldModel.

Though I would recommend moving your content in ServerStorage using PivotTo instead of physics to get more deterministic behavior, where PivotTo has no physics dependency at all, and will work on Parts / Models anywhere.

4 Likes