|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 29 Apr 2012 02:22 PM |
| The Weld object doesn't disconnect objects when it gets shot at with explosions! |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 29 Apr 2012 04:07 PM |
MrNicNac, stop posting too early!
Now, it looks like I'm posting too late... |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 29 Apr 2012 04:14 PM |
Huh..
Try creating the welds after parenting the object. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 29 Apr 2012 04:17 PM |
T_T
Can I move them to lighting after creating the joints? |
|
|
| Report Abuse |
|
|