janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:14 PM |
I have this: -- direction=script.Value.Value script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(direction) -- The value has the angle I want, but it just gives me this error: 20:07:47.566 - Workspace.Part.Script:3: bad argument #3 to 'fromEulerAnglesXYZ' (number expected, got no value)
What am I doing wrong? |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 10:15 PM |
| Put it in a float? MAke sure there is something inside the variable? |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 10:20 PM |
--What output say direction=script.Value.Value print(direction) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(direction) |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:20 PM |
| It's a vector3value, and it does have the numbers I want. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 26 Aug 2013 10:21 PM |
| fromEulerAnglesXYZ() takes 3 numbers, not a Vector3 :L |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:22 PM |
@Screw: 0.619343221, 0.357578009, 0.698964953 20:18:07.922 - Workspace.testbrick.Script:4: bad argument #3 to 'fromEulerAnglesXYZ' (number expected, got no value) 20:18:07.922 - Script 'Workspace.testbrick.Script', Line 4 20:18:07.922 - stack end |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Aug 2013 10:24 PM |
Really? O_o I always thought it was a method... |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:25 PM |
I took it out of a working cframe door, so you're wrong. But I'm still stuck. Would another kind of value work? |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:28 PM |
Using * CFrame.Angles(direction) also didn't work. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Aug 2013 10:30 PM |
Then it's not that part.
They should work as:
Angles(x, y, z [, etc]) |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:33 PM |
| I don't know what you mean. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Aug 2013 10:34 PM |
Part.CFrame = Part.CFrame * CFrame.Angles(math.pi, 0, 0) Will rotate the part by the X position |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 10:35 PM |
@cnt ikr
@op Like I said, you feed it 3 numbers, not a Vector3 Value. Just try this to avoid changing everything cause of this :x
direction=script.Value.Value script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(tostring(direction):match("([^,]+),([^,]+),([^,]+)"))
--or you could be bland and be like
CFrame.fromEulerAnglesXYZ(direction.x,direction.y,direction.z) |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:44 PM |
| Um.. What kind of value stores three numbers? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Aug 2013 10:45 PM |
Vector3Value? CFrameValue? UDim2Value stores 4 |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:52 PM |
Vector3 didn't work with EulerAnglesXYZ(direction.x,direction.y,direction.z) CFrameValue isn't showing a "Value" property. I don't even see a UDim2Value anywhere. |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 10:55 PM |
| Script and output while trying "EulerAnglesXYZ(direction.x,direction.y,direction.z)" |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
| |
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Aug 2013 10:57 PM |
| I have to go for tonight, I guess I'll bump this tomorrow. |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 11:00 PM |
Just tested script and works. You prolly did something wrong...
direction=script.Value.Value script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(direction.x,direction.y,direction.z) |
|
|
| Report Abuse |
|
|