Thats another fix, though turning the massless property of the clone part would fix it, when the part is added to the players character and welded to the left lower leg, I suppose its clone parts mass thats causing the issue.
Yeah, thats the most probable issue, that the part has Mass. Indeed that when welding parts to the character Massless should be on, or character will become fat by adding more mass into them xD
I fixed the problem with the movement being weird and the part colliding with the ground/other parts. My current issue right now is that I’m unable to position the part to be at the player’s leg. How would I go about doing this?
Current code:
local player = game.Players.LocalPlayer
repeat wait(1) until player.Character
wait(4)
local weld = Instance.new("Weld")
local hrp = player.Character:FindFirstChild("HumanoidRootPart")
local clone = game.ReplicatedStorage.Killzone:Clone()
clone.Parent = workspace
weld.Part0 = clone
weld.Part1 = hrp
clone.CFrame = hrp.CFrame * CFrame.new(0, -2, 0)
weld.Parent = hrp
Use the earlier code, don’t change the Part1 to HumanoidRootPart, but add clone.Massless=true, trust me, it will work.
local player = game.Players.LocalPlayer
repeat wait(1) until player.Character
wait(4)
local weld = Instance.new("Weld")
local leftLowerLeg = player.Character:FindFirstChild("LeftLowerLeg")
local clone = game.ReplicatedStorage.Killzone:Clone()
clone.Parent = player.Character
clone.CFrame = leftLowerLeg.CFrame * CFrame.new(0, 5, 0)
clone.Massless = true --this is where you set massless to true.
weld.Part0 = clone
weld.Part1 = leftLowerLeg
weld.Parent = leftLowerLeg
I didnt mean to change the CFrame of the Killzone part to the HRP. Just set it to the foot part the CFrame. But, the weld change it to HRP or Torso, otherwise if its welded to the foot, it will move weirdly, cause its following the foot, unless thats what you want, that the kill zone to move welded to the foot.
If you want the Part to be welded to the foot, HumanoidRootPart, or whatever then that’s fine, but if you want it to weld at an offset you need to set the Weld C0 and C1 properties for the offset.
The code @CelestialHonour provided works. But, still having the issue that the part will follow the foot, theres some question I would like to ask.
First, what is the goal? Why you are doing this on client side? you called that part Killzone? what you mean? its for killing other players? that wont work if its client sided.
Mainly, the goal of your approach. Why weld it to the leg? why client side? what you expect this Killzone part to do?