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

Weld wont work?

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

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)

2 comments

0

what does the Weld.C1 line do?

1

@scottmike0 It's similar to C0. The weld CFrame is determined sort of like this: weld.C0 * weld.C1:inverse()

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