|
| 29 Jun 2014 03:20 PM |
When I try to weld handles to a fake character inside CurrentCamera, I get an error thats sayd 'bad cast' even though it works for all of the other parts of the character(Torso,Head,Left Arm,etc..). Script;
function Weld(a, b) local weld = Instance.new("ManualWeld") weld.Part0 = a weld.Part1 = b weld.C0 = CFrame.new() weld.C1 = b.CFrame:inverse() * a.CFrame weld.Parent = a return weld end
--later on in the script
elseif v:IsA("Hat") then c = v.Handle:Clone() c.Parent = newModel
Weld(v,c) --Calls the weld function
end |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2014 03:30 PM |
What line is your problem on? Please give us the line that the problem occurs on next time.
But why are you trying to weld a hat to a handle? Hats are not parts, and can't be treated as such. Try welding to the head of the character instead of the hat. Hats are not physical objects, and can't be interacted with physically.
Besides, even if they could, you are basically welding a part to itself.
|
|
|
| Report Abuse |
|
|
|
| 29 Jun 2014 03:36 PM |
I just realized I was welding the Handle to the Hat, thanks. But the error was here;
function Weld(a, b) local weld = Instance.new("ManualWeld") weld.Part0 = a ------------------------Bad Cast weld.Part1 = b weld.C0 = CFrame.new() weld.C1 = b.CFrame:inverse() * a.CFrame weld.Parent = a return weld end |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2014 04:02 PM |
You can't weld hats.
weld(v.Handle, c) |
|
|
| Report Abuse |
|
|