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

Trying to weld a part to the camera. What is wrong with my code?

local block = Instance.new("Part")
block.Parent = game.Workspace
block.Name = "block"
block.Shape = Enum.PartType.Block
block.CanCollide = false
block.Size = Vector3.new(0.3, 0.3, 0.3)
game:GetService("RunService").RenderStepped:connect(function()
	block.LocalTransparencyModifier = 0.4
end)

local Weld = Instance.new("Weld", block)
Weld.Part0 = game.Workspace.CurrentCamera
Weld.Part1 = block
Weld.C0 = CFrame.new(0,0,1)  

thanks for your help.

1 answer

Simple enough. The Camera class does not inherit BasePart, so you cannot assign it to your weld's Part0 or Part1 property.

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