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

How would you weld a part to a player?

Asked by 7 years ago

Okay, so what I tried to do is to make an aura that would sit at the player's feet and move around with the player.

        local aura = Instance.new("Part", character)
        aura.Shape = "Cylinder"
        aura.Size = Vector3.new(0.3,20,20)
        aura.Material = "Neon"
        aura.BrickColor = BrickColor.Green()
        aura.Transparency = 0.5
        aura.CanCollide = false
        aura.Anchored = false
        aura.CFrame = aura.CFrame * CFrame.Angles(0,0,-140)
        local weld = Instance.new("Weld", aura)
        weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
        weld.C0 = weld.C0 - Vector3.new(0,8,0)
        weld.Part0 = aura
        weld.Part1 = character:WaitForChild("Humanoid").Torso

The problem with this is that it makes the player's movement really awkward as if the aura can collide, but I set CanCollide to false. Is there a better way to create the aura underneath the player without welds or how would I fix this?

1 answer

Log in to vote
0
Answered by 7 years ago

Heads-Up Im fixing this on Mobile. Im tired so... This may not work as I planned. ;p If it doesnt work. Then, sorry 2 tired. Hopefully it does tho.

local char = game.Players.LocalPlayer.Character
local h = char:WaitForChild("Humanoid")
local t = char:WaitForChild("Torso")

local aura = Instance.new("Part", char)
aura.Shape = "Cylinder"
aura.Size = Vector3.new(0.3,20,20)
aura.Material = "Neon"
aura.BrickColor = BrickColor.new("Green")
aura.Transparency = 0.5
aura.CanCollide = false
aura.CFrame = aura.CFrame * CFrame.new() * CFrame.Angles(0,0,-140)
local weld = Instance.new("Weld", aura)
weld.Part0 = aura
weld.Part1 = char.Torso
weld.C0 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
weld.C0 = weld.C0 - Vector3.new(0,8,0)
aura.Anchored = false
Ad

Answer this question