WeldConstraint Part0 code sample produces an error

Issue Description
Part0’s code sample doesn’t create a new line between setting Part0 and Part1 which would cause an error. Just need to add a new line so that Part0’s code sample matches Part1’s code sample and then the error’s gone.

Issue Area: DevHub Content
Page URL: WeldConstraint | Roblox Creator Documentation

1 Like

Thanks for the report! We’ve filed a ticket and we’ll follow up when we have an update for you.

1 Like

Housekeeping: the same problem code sample carried over to documentation in the Creator Hub.

The code sample should be as follows:

local partA = Instance.new("Part")
local partB = Instance.new("Part")

partA.Position = Vector3.new(0, 10, 0)
partA.Parent = game.Workspace

partB.Position = Vector3.new(0, 10, 10)
partB.Parent = game.Workspace

local weld = Instance.new("WeldConstraint")
weld.Parent = partA
weld.Part0 = partA
weld.Part1 = partB

It is currently:

local partA = Instance.new("Part")
local partB = Instance.new("Part")

partA.Position = Vector3.new(0, 10, 0)
partA.Parent = game.Workspace

partB.Position = Vector3.new(0, 10, 10)
partB.Parent = game.Workspace

local weld = Instance.new("WeldConstraint")
weld.Parent = partA
weld.Part0 = partAweld.Part1 = partB
1 Like

Hi there,
Thanks for the follow-up. I’ve corrected the code sample on the new Documentation site:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.