|
| 12 Jan 2017 02:45 PM |
| function Weld(x,y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local ## # ##################### local C1 = y.CFrame:inverse()*CJ #### # ## W.C1 = C1 W.Parent = x end for i,v in ipairs(script.Parent:GetChildren()) do if v:IsA("BasePart") and v.Name ~= "Center" then Weld(script.Parent.Center, v) v.Anchored = false end end I have this script that welds every part in a model to the center, but when I change the CFrame of the center, none of these parts are moving along... None of the parts is welded to other objects, whether it be anchored or not, the center however is anchored, but that shouldn't cause any trouble, right? |
|
|
| Report Abuse |
|
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 13 Jan 2017 02:53 AM |
Your script is censored, but yeah so long as every part has a weld attached to the center, it shouldn't fall apart when you CFrame the center, in the same manner that a tool with tons of welds, and one weld between the Handle and the Right Arm doesn't fall apart when the character moves their arm around.
Make sure you're CFraming and not changing the position.
|
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:29 AM |
It's not that important that the script is censored, it's really just a standard script that welds all the parts to one single part. And it's not falling apart, the parts are actually welded, because if I delete the parts, the construction falls apart. I can also see that the Center part is moving, but the parts that are welded to this center part just remain in place.
I have done welding before, exactly like this, only then it worked and now it doesn't and I have no clue why. |
|
|
| Report Abuse |
|
|
Lucas_Lua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7521 |
|
|
| 13 Jan 2017 04:31 AM |
I think I remember an old visual bug where if you had a bunch of unanchored parts welded to an anchored part, and then changed its position, the parts sometimes didn't update to their new positions visually...
Try unanchoring the center and see what happens. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:34 AM |
| When the center part is unanchored, it does seem that it's all welded together, but I can't do it like that because I need the center part to be in that position. I want the whole model to rotate around the center. I used SetPrimaryPartCFrame before, but it was too inconsistent after a while, the offset changed and its performance was a bit bad as well... |
|
|
| Report Abuse |
|
|
Lucas_Lua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7521 |
|
|
| 13 Jan 2017 04:35 AM |
| You could use a BodyPosition and BodyGyro to keep it in the same position. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:37 AM |
| But the parts have to collide and it goes through some other parts as well... |
|
|
| Report Abuse |
|
|