|
| 17 Nov 2012 08:10 AM |
This is intended to simulate a weld by moving part B to part A constantly considering an offset that was set at the start, can anyone see why it is not working?
p = CFrame.new(a.Position) while true do wait() b.CFrame = a.CFrame * CFrame.new() * b.CFrame:inverse() * (p):inverse() end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 17 Nov 2012 10:44 AM |
First, you never defined a. Second, while wait() do will work better if you're just going to put while true do wait() |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 17 Nov 2012 11:01 AM |
This is how a weld would work:
local a, b = Workspace.a, Workspace.b local os = a.CFrame.p - b.CFrame.p while true do wait() b.CFrame = a.CFrame * CFrame.new(-os) end |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Nov 2012 12:27 PM |
| How could I have it also include rotation? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 17 Nov 2012 01:25 PM |
I tried local rx, ry, rz = part1.CFrame:toEulerAnglesXYZ() - part2.CFrame:toEulerAnglesXYZ() local rotation = CFrame.Angles(rx, ry, rz) |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Nov 2012 01:31 PM |
I just tried local rx, ry, rz = part1.CFrame:toEulerAnglesXYZ() local rotation = CFrame.Angles(rx, ry, rz) local rx2, ry2, rz2 = part2.CFrame:toEulerAnglesXYZ() local rotation2 = CFrame.Angles(rx2, ry2, rz2) local rot = rotation - rotation2 Still nothing |
|
|
| Report Abuse |
|
|