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 » Scripters
Home Search
 

Re: Welding

Previous Thread :: Next Thread 
hisokachan is not online. hisokachan
Joined: 23 Dec 2014
Total Posts: 121
12 Jan 2015 11:58 AM
I'm currently doing the following:


local Book = game.ReplicatedStorage.Book

local BRWeld = Instance.new("ManualWeld")
BRWeld.Parent = Book
BRWeld.Part0 = Book.BackLeft
BRWeld.Part1 = Book.BackRight
BRWeld.C0 = CFrame.new(0, 0, 0)

local PLWeld = Instance.new("ManualWeld")
PLWeld.Parent = Book
PLWeld.Part0 = Book.BackLeft
PLWeld.Part1 = Book.PageLeft
PLWeld.C0 = CFrame.new(0, 0, 0)

local PRWeld = Instance.new("ManualWeld")
PRWeld.Parent = Book
PRWeld.Part0 = Book.BackLeft
PRWeld.Part1 = Book.PageRight
PRWeld.C0 = CFrame.new(0, 0, 0)


To get my book of 4 parts to be welded together. What I want to know is whether there is an easier way than to have to individually weld each part as models can be hundreds in parts and also how it will automatically set the right cframe positions since these all put the parts on top of each other.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
12 Jan 2015 12:10 PM
Yes there is a way.

However, I do not know this way.

TO shed some light,

local Welds = {}

local weld = function(p1, p2, c0, c1)
local w = Instance.new("Weld")
w.P0 = p1
w.P1 = p2
w.C0 = c0 or CFrame.new()
w.C1 = c1 or CFrame.new()
return w
end

weld(Workspace.Part, Workspace.Part1, CFrame.new(5,5,5))
etc.

There is a way to automatically weld all parts...
Something about this can be learned in CFrame... I believe the methid was :ToObjectSpace() and stuff.
Report Abuse
hisokachan is not online. hisokachan
Joined: 23 Dec 2014
Total Posts: 121
12 Jan 2015 03:11 PM
Bump
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
12 Jan 2015 03:13 PM
local model = workspace.Model
local mainPart = model.PART

for i, v in pairs(model) do
if v:IsA("BasePart") and v ~= mainPart then
local weld = Instance.new("Weld", v)
weld.Part0 = mainPart
weld.Part1 = v
weld.C0 = mainPart.CFrame:inverse() * v.CFrame
end
end

logic is logical
Report Abuse
hisokachan is not online. hisokachan
Joined: 23 Dec 2014
Total Posts: 121
12 Jan 2015 03:18 PM
That works how I want it, can someone explain how you got that this?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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