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
 

Re: Weld Object vs. Weld Surface

Previous Thread :: Next Thread 
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 02:09 PM
So, I've been using surface welds to make this model. Now I'm at a point where I simply cannot use a surface weld.
For some reason, a part of me dies inside when I use a weld object. I feel like they are extremely messy and cause lag, among other problems. However, I do not know if any of those things are actually true.

Should all my things use weld objects? Do they essentially behave the same as weld surfaces, except they don't necessarily need to be on the surface? Are there problems that weld objects cause?

Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
29 Apr 2012 02:20 PM
I think they react the same, except weld surfaces have to be touching.
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
29 Apr 2012 02:21 PM
Can you teach me how to make a weld script? I tried Roblox Wiki's Intro To Weapons Weld Script. The script on there didn't work.
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
29 Apr 2012 02:22 PM
The Weld object doesn't disconnect objects when it gets shot at with explosions!
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 02:26 PM
@Dozer?

Really? That's good to know, thanks.

@Quenty
So welding isn't bad like I seem to think?
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
29 Apr 2012 03:06 PM
"The Weld object doesn't disconnect objects when it gets shot at with explosions!"

It does... Where in the world did you get that info from?

"So welding isn't bad like I seem to think?"

Well, use the weld surface whenever you can, but, if you really can't, then use the Weld object.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Apr 2012 03:09 PM
Ahem...the Weld Object is a tad less memory-demanding than the surface weld. So yes, you seem a **tad** bit paranoid, hmm?
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 03:43 PM
"Ahem...the Weld Object is a tad less memory-demanding than the surface weld. So yes, you seem a tad bit paranoid, hmm?"

Just a tad. A really, *really* big tad.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 03:58 PM
Alright, so I've successfully begun to use weld objects, and it works well.

There's just one thing that's bugging me. First, I'll explain what I'm doing:
I CFramed a bunch of models, and put 'em in lighting
When the game starts, I weld all the parts in each of those models to the "base" of the model (oops, just realized that I welded the base to itself)
I unanchor all the parts, still in lighting
Throughout the game I place clones of these welded models into workspace.


Thing that's bugging me: "Weld should not be a child of Lighting...."
I understand that those warnings are harmless, but they are very annoying and it makes me not feel as clean. What can I do?
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Apr 2012 04:02 PM
"annoying and it makes me not feel as clean."

It's a shame you don't witness surgeries on the human body. That is not clean.

Anyways, parent the welds to the JointsService (which cannot be obtained by GetService).
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 04:04 PM
"It's a shame you don't witness surgeries on the human body. That is not clean."

>.>

if it can't be obtaiend by GetService(), how do I get it? Just game.JointService?
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
29 Apr 2012 04:04 PM
"I understand that those warnings are harmless"

The warnings themselves are harmless, but what they're trying to tell you is not harmless.

You should always listen to warnings, because they're telling you that you're doing something wrong, even if it still works.

You're supposed to put the welds in the JointsService, I think.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Apr 2012 04:06 PM
"if it can't be obtaiend by GetService(), how do I get it? Just game.JointService?"

Yes....? How else would...

Yes.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
29 Apr 2012 04:06 PM
"if it can't be obtaiend by GetService(), how do I get it?"

Good question.

local JointsService

for _, child in next, Game:GetChildren() do
if child:IsA('JointsService') then
JointsService = child
end
end

assert(JointsService, "The JointsService must be present.")


That's the right way to do it, really.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
29 Apr 2012 04:07 PM
MrNicNac, stop posting too early!

Now, it looks like I'm posting too late...
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Apr 2012 04:08 PM
That's pointless, as JointsService is always present in a game.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 04:09 PM
"Yes....? How else would...
Yes."

Sorry, I tested it before I replied and got an error, so I asked.
Now I realize that I left the s off of "Joints"


Thanks Julien and MNN. :)
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
29 Apr 2012 04:11 PM
"That's pointless, as JointsService is always present in a game."

It could potentially not be, if the user decided to play a little with the XML.

You never know...
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 04:11 PM
...I'm back.


When I parent the welds to JointsService, they break when I parent the models to workspace, even when using :MakeJoints()


They worked fine when the welds were not in JointsService.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Apr 2012 04:12 PM
"...I'm back."

Ha.

Umm...your new problem is beyond me with the given information right now. You are parenting them first, yes?

Instance.new("Joint", game.JointsService)
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
29 Apr 2012 04:14 PM
Huh..

Try creating the welds after parenting the object.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 04:15 PM
Yes, yes I am. (although I'm making a Weld, not a Joint if that matters. The wiki says welds go their too, and I think weld is a subclass of joint)
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 04:15 PM
I'll just post my code first.

for _, v in pairs(game.Lighting.Units:GetChildren()) do
v.PrimaryPart = v.Base
for x, y in pairs(v:GetChildren()) do
if y:IsA("BasePart") and y ~= v.Base then
weld = Instance.new("Weld")
weld.Parent = game.JointsService
weld.Part0 = v.Base
weld.Part1 = y
weld.C0 = CFrame.new()
weld.C1 = y.CFrame:inverse() * v.Base.CFrame
y.Anchored = false
end
end
end
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Apr 2012 04:16 PM
Joint was an example, not a true instance.

Anyways, joints won't work when created attached to an instance in the Lighting. They must be in the Workspace when made, when putting them in the JointsService.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
29 Apr 2012 04:17 PM
T_T

Can I move them to lighting after creating the joints?
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