Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 09 Jul 2011 05:45 PM |
I tried doing this:
print(game.Workspace.Part.CFrame.Angles.X)
But the output gave me THIS:
Sat Jul 09 17:41:17 2011 - Angles is not a valid member Sat Jul 09 17:41:17 2011 - Remote Url, line 1 stack end Sat Jul 09 17:41:17 2011 - Remote Url, line 1 stack end
What I want to do is find out the X value of CFrame.Angles, or CFrame.fromEulerAnglesXYZ, as shown below:
game.Workspace.Part.CFrame = CFrame.new(5, 5, 5,) * CFrame.Angles(math.rad(90), --[[this one to the left--]] math.rad(0), math.rad(0))
I want to be able to print the X value of CFrame.Angles to the output, in simple terms. |
|
|
| Report Abuse |
|
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
| |
|
|
| 09 Jul 2011 05:52 PM |
| part.CFrame:ToEulerAnglesXYZ() |
|
|
| Report Abuse |
|
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 09 Jul 2011 05:57 PM |
@AgentFireFox
print(game.Workspace.Igloopart37.CFrame:ToEulerAnglesXYZ())
> print(game.Workspace.Igloopart37.CFrame:ToEulerAnglesXYZ()) Sat Jul 09 17:56:44 2011 - ToEulerAnglesXYZ is not a valid member Sat Jul 09 17:56:44 2011 - Remote Url, line 1 stack end Sat Jul 09 17:56:44 2011 - Remote Url, line 1 stack end
D: |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 09 Jul 2011 06:05 PM |
Hmm. The T might be lower-case... X_X It is...
part.CFrame:toEulerAnglesXYZ()
|
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 09 Jul 2011 06:11 PM |
> print(game.Workspace.Igloopart37.CFrame:toEulerAnglesXYZ()) -3.1415927410126 1.0471974611282 -3.1415927410126
Is there a way to round these numbers to the nearest hundredth? When CFraming, I usually use the number in the tenth place and the hundredth place. |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 09 Jul 2011 06:37 PM |
function round(num, base) return math.floor(0.5 + math.abs(num)/base)*base*math.abs(num)/num end
print( round(-3.1415927410123, 0.01) ) --> -3.14 |
|
|
| Report Abuse |
|
|