|
| 05 May 2013 08:28 PM |
I've got a script where I generate a Vector3 Value object inside of each part in a group, and it's supposed to assign rotation vector3 to said object's value. I first tried
ORot.Value = ORot.Parent.CFrame:toEulerAnglesXYZ()
But it told me that instead of recieving Vector3, it was given number values. I was thinking "yeah, that's fine, I knew about that beforehand" and changed the code to the following:
ORot.Value.x, ORot.Value.y, ORot.Value.z = ORot.Parent.CFrame:toEulerAnglesXYZ()
But instead of working... it gave me the above error. I'm wondering why in oblivion you can't assign the separate parts of a Vector3- or am I just doing something horribly wrong? |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 08:32 PM |
Take off the :toEulerAngles on z, and try this:
z:toEulerAnglesXYZ() |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 08:34 PM |
That... doesn't sound like it would work. "z" is part of a Vector3 Value object, detached from actual parts... meaning it's not actually doing anything, just being a value.
I'll try it anyways, in case my understanding of syntax is some kind of wrong. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 08:36 PM |
| Didn't take long, the script's error check was already telling me it wouldn't work (thank you wiggly red line). |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 08:45 PM |
ORot.Value = Vector3.new(ORot.Parent.CFrame:toEulerAnglesXYZ())
I think you got that error because you can't set Position.x, you can only read it |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 08:57 PM |
| Ah, thank you. I keep forgetting that if you want a Vector3, you need to make a 'new' one. |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 May 2013 09:48 PM |
Went through testing, thought that this was dealt with, but it turns out the major issue I'm having at the moment is this again.
I tried by that method, but it would only produce a Vector3 of 0, 0, 0. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 09:49 PM |
ORot.Value = Vector3.new(ORot.Parent.CFrame:toEulerAnglesXYZ())
No errors produced, just gives me 0, 0, 0... and I know that the parts are most certainly not all at the origin. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 09:58 PM |
| It gets the rotation not position o-o. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 10:36 PM |
Moment of stupid. Position is a totally different problem. Sorry.
I'll look into it. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 10:52 PM |
Actually, I just checked both the values I'm creating (one for position, the other for rotation). They both show up as 0, 0, 0.
Any insight? |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 10:53 PM |
| Nevermind. I'll make a new thread on it tomorrow, when I have the time to actually respond. |
|
|
| Report Abuse |
|
|