Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
| |
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
| |
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 18 Jan 2012 09:08 AM |
They are anchored? And you're thinking about welds? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 18 Jan 2012 09:15 AM |
| You cant do that with welds without having them all unanchored. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 18 Jan 2012 09:23 AM |
Does model:MoveTo() (or whatever) work?
Anyway, I'd guess it's more efficient to let roblox handle it (the weld and cframe once one) (hopefully it's on the c side), but you could always try both and measure how long each one takes. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Shobobo99
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 5754 |
|
|
| 18 Jan 2012 11:26 AM |
Now that you have that settled out, which of these two methods of changing the CFrame of parts based on another part's CFrame would be more efficient?
http://www.roblox.com/Forum/ShowPost.aspx?PostID=61606516 |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 18 Jan 2012 11:44 AM |
| @Oys: Because if you use the second option you'll watse memory on Welds and then again Roblox itself would re-position them and we know that Roblox is inefficient in most parts when it comes to scripting. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 18 Jan 2012 12:31 PM |
What lags more, many parts being CFramed quite a bit within a short period of time, or all those parts being welded to an object that's CFrame is being changed constantly within a short period of time.
Welds use up memory, and CFrames create lag (If colliding with other parts). I don't really know what'd be more efficient, though. Run a few tests.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
HotThoth
|
  |
 |
| Joined: 24 Aug 2010 |
| Total Posts: 1176 |
|
|
| 18 Jan 2012 02:32 PM |
| The key issue here is physics. Doing things in Lua vs. C++ should not make nearly as big an impact as having anchored vs. unanchored parts. If welding parts to an anchored part has them treated (for physics) as anchored by the engine, then that's the best way to do it. Otherwise, the best way is to simply CFrame everything separately so you can still have everything be anchored. I'm not actually sure whether or not the weld-to-anchored-part optimization is implemented, though (although I imagine it would be). |
|
|
| Report Abuse |
|
|
|
| 18 Jan 2012 07:52 PM |
There's also the idea that if you use the CFrame method you can clone the original CFrame and not even have to move the original part.
@HotThoth
Would a method that calls a function on all children of an object increase performance if you were working with hundreds of children at once?
~+[CROOKITY BANDED SNAKES]+~ |
|
|
| Report Abuse |
|
|
|
| 18 Jan 2012 07:56 PM |
I wouldn't use welds if I were you. Welds have a tendency to error (double point?), with large amounts (and small) of parts.
I would CFrame it. However, around 300 parts moving with CFrame creates lag, so.... |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2012 11:52 AM |
Remember that with welds youre replicating a single body moving while with cframing youre replicating 1000 bodies (each brick separately) moving.
The result is quite ugly, i once made a crane which used cframe to move around and rotate the arm thingy and the parts didnt move in sync... |
|
|
| Report Abuse |
|
|
HotThoth
|
  |
 |
| Joined: 24 Aug 2010 |
| Total Posts: 1176 |
|
|
| 19 Jan 2012 12:17 PM |
| @popin: not quite sure what you mean; example plox? |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 19 Jan 2012 01:01 PM |
"@popin: not quite sure what you mean; example plox?"
I think he means doing something like this:
for i,v in pairs(workspace:GetChildren()) do if v.Name == "Block" then v.Touched:connect(function(d) print(v.." has been touched by: "..d); end) end end
|
|
|
| Report Abuse |
|
|
McBlocker
|
  |
| Joined: 16 Nov 2008 |
| Total Posts: 1721 |
|
|
| 20 Jan 2012 01:57 PM |
Using welds would be faster (and simpler), but the thing with welds is that you never know if they'll keep up. As I'm sure you've experienced, lots of welds equals lots of image probems.
So it's really effeciency vs realness. (Couldn't think of a better word than "realness") |
|
|
| Report Abuse |
|
|