generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Why cant I weld Handles inside hats?

Previous Thread :: Next Thread 
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jun 2014 04:02 PM
You can't weld hats.

weld(v.Handle, c)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image