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

Weld wont work?

Asked by
Nidoxs 190
8 years ago

Should put the part in the middle of Characters torso and stay there even if the CHARACTER moves. Won't work, just falls through Baseplate. (Yes I know CanCollide = false)

Char = game.Players.LocalPlayer.Character
function Protect()
    local Shield = Instance.new("Part")
    Shield.Parent = workspace
    Shield.FormFactor = Enum.FormFactor.Custom
    Shield.Size = Vector3.new(.2,.2,.2)
    Shield.CFrame = Char.Torso.CFrame
    Shield.Transparency = .65
    Shield.CanCollide = false
    Shield.Material = Enum.Material.Neon
    local Weld = Instance.new("ManualWeld",Char.Torso)
    Weld.Name = "Weld"
    Weld.Part0 = Char.Torso
    Weld.Part1 = Shield
    Weld.C0 = CFrame.new(0,0,0)
    Weld.C1 = CFrame.new(0,.01,0)
end

1 answer

Log in to vote
0
Answered by 8 years ago

It shouldn't be:

Weld.C0 = CFrame.new(0,0,0)
Weld.C1 = CFrame.new(0,.01,0)

but something like:

Weld.C0 = Char.Torso.CFrame:inverse()       --When you twist,spin and jump it moves along.
 -- Maybe add some distance if you want by doing + CFrame.new(.2,0,0) (example)
Weld.C1 = Shield.CFrame:inverse()

Also it's :

local Weld = Instance.new("Weld",Char.Torso)

not:

local Weld = Instance.new("ManualWeld",Char.Torso)
0
what does the Weld.C1 line do? scottmike0 40 — 8y
1
@scottmike0 It's similar to C0. The weld CFrame is determined sort of like this: weld.C0 * weld.C1:inverse() ZarsBranchkin 885 — 8y
Ad

Answer this question