|
| 28 Mar 2015 09:25 PM |
| I'm not quite sure why you need to use this when you weld. I know what it means, but why inverse the CFrame coords? Wouldn't it throw off the CFrame? |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Mar 2015 09:32 PM |
This is why we use better functions for more modern code. There's no need to worry about the inverse of a CFrame using the correct CFrame functions ROBLOX provides.
Weld.C1 = Weld.Part1.CFrame:toObjectSpace(Weld.Part0.CFrame)
Will make Part1 stay where it was at and be welded to Part0 (parent the weld _after_ doing that).
That's a lot easier to understand yeah? If not, here's the simple explanation:
Weld's work in object-space coordinates. That means CFrame.new(0,1,0) is not 0,1,0 in the game. It's 0,1,0 _away_ from another CFrame.
That line there takes Part1.CFrame and turns it into object-space coordinates OF Part0.CFrame. |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2015 09:33 PM |
It basically is the opposite of the cframe, quite like -1 instead of 1.
HOWEVER, CFrame rotations can NEVER BE NEGATIVE, so it just flips the cframe so it looks backwards. |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2015 09:34 PM |
| So, it basically makes sure that the CFrame is centered. I got it now. |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2015 09:34 PM |
| At least with tools and welds anyways |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2015 09:35 PM |
"So, it basically makes sure that the CFrame is centered. "
Um... no |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2015 09:39 PM |
think of it like this
a = 1 b = 5 c = 5 + 1:Inverse() print(c) -- 4
We do this because we cannot use / or - operators to get the difference between the two cframes. |
|
|
| Report Abuse |
|
|
| |
|