|
u prob already kno dis
Ish way to get rotation of brik.
function GetPartRotation(P)
local tab = {}
x,y,z,tab.r1,tab.r2,tab.r3,tab.r4,tab.r5,tab.r6,tab.r7,tab.r8,rab.r9 = P.CFrame:components()
return tab
end
Rot = GetPartRotation(PartLocation)
print(Rot.r1,Rot.r5,Rot.r9)
|
|
|
Couple of typos, fixed.
function GetPartRotation(P)
local tab = {}
x,y,z,tab.r1,tab.r2,tab.r3,tab.r4,tab.r5,tab.r6,tab.r7,tab.r8,tab.r9 = P.CFrame:components()
return tab
end
Rot = GetPartRotation(PartLocation)
print(Rot.r1,Rot.r5,Rot.r9)
|
|
|
wtf, im getting alot of views but no replies. |
|
|
I'm pretty sure that all of us know this.
Keyboard not found. Press F1 to continue. |
|
|
You would be surprised by the amount of advanced scripters that dont. |
|
OysiJoin Date: 2009-07-06 Post Count: 9058 |
"print(Rot.r1,Rot.r5,Rot.r9)"
...
No, I wasn't really surprised that you didn't know how this works. |
|
|
I did know, i just posted it because iv'e seen quite a lot of people that don't. |
|
|
And i don't see what your pointing out there, there's nothing wrong with that line. |
|
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
If you got that from here (link below) and saw (script below), then that isn't how it works.
http://wiki.roblox.com/index.php/Euler_angles
=CFrame.Angles(x, 0, 0)
*CFrame.Angles(0, y, 0)
*CFrame.Angles(0, 0, z)
That is just explaining how the fromEulerAnglesXYZ and Angles functions prioritize the angle rotation. You need to use trig to retrieve the angles from the components. |
|
|
bohdan77Join Date: 2008-08-10 Post Count: 7944 |
If you know, then why are you doing it incorrectly? |
|
bohdan77Join Date: 2008-08-10 Post Count: 7944 |
Actually, scratch that. |
|
|
and the print(Rot.r1,Rot.R5,Rot.R9) is just an example of printing 3 numbers of the rotation. |
|
|
/フフ ム`ヽ
/ ノ) ∧ ∧ ) ヽ
/ | (´・ω・`⌒(ゝ._,ノ
/ ノ⌒7⌒ヽーく \ /
丶_ ノ ノ、 |/
`ヽ `ー-‘_人`ーノ
丶  ̄ _人’彡ノ
/`ヽ _/\__ Post this on 10 others forums if you
want to look like this epic |
|