Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Possible to weld parts to a camera?

Asked by
LuaQuest 450 Moderation Voter
9 years ago

Just wondering, would it be possible to weld a part to a player's camera? For example:

local Cam = workspace.CurrentCamera
local Part = Instance.new("Part",Cam)
local Weld = Instance.new("Weld",Part)

Weld.Part0 = Part
Weld.Part1 = Camera

I'm not really good with welding, so I'm not sure what results this would yield, or if it's even valid. Hope you can help.

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

No. Snaps need to have BaseParts as their Part0 and Part1.

If you want a brick to perfectly follow the camera (locally) you can just update its CFrame on RenderStepped:

game:GetService("RunService").RenderStepped:connect(function()
    part.CFrame = workspace.CurrentCamera.CoordinateFrame * CFrame.new(10, 10, -20)
end)
0
Thanks. LuaQuest 450 — 9y
0
What if I wanted to make a model with multiple parts follow the camera? LuaQuest 450 — 9y
Ad

Answer this question