kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
|
| 10 Aug 2011 04:06 PM |
I need to make a weld to weld a brick a certain number of studs infront of another brick. I can get the lookVector, but I'm not sure how to turn it into the weld's C1.
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2011 04:49 PM |
This is how I would weld a brick 5 studs in front of another with no rotation:
part1 = workspace.Part1 -- Part stays still part2 = workspace.Part2 -- Part to move in front of part1 parentOfWeld = part1 -- Should always be part1
weld = Instance.new("Weld", parentOfWeld) weld.Part0 = part1 weld.Part1 = part2 weld.C0 = CFrame.new(part1.CFrame.lookVector*5) -- Change 5 to amout of studs to translate --print(weld.C0)
|
|
|
| Report Abuse |
|
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
|
| 11 Aug 2011 03:39 PM |
| I kinda figured, but I didn;t wanna mess it up. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 11 Aug 2011 03:42 PM |
Please :/ don't listen to computer, his script is gonna fail.
part1 = workspace.Part1 part2 = workspace.Part2
weld = Instance.new("Weld", parentOfWeld) weld.Part0 = part1 weld.Part1 = part2 weld.C1 = CFrame.new(0, 0, 5) |
|
|
| Report Abuse |
|
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
| |
|