|
| 13 Mar 2015 07:39 PM |
I'm building a mech, but I need to know how if statements and rotation work, and the wiki doesn't have anything on the two used together.
the script that doesn't work is: if (workspace.r1.Rotation == CFrame.Angles(-180, -0, -38.054)) then
It's not the part inside because all it does is change a color, which works with a touch function, so I know it's just the line above that doesn't work. |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2015 11:17 PM |
| Can rotation even be inside the argument of an if statement? |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2015 11:19 PM |
| just found out this is not a "help forum" when I was directed here if i needed help... |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 14 Mar 2015 12:22 AM |
No this is one of the two places to go for help.
"if (workspace.r1.Rotation == CFrame.Angles(-180, -0, -38.054)) then"
The error in this is you are checking if a Vector3 value(Rotation) equals a CFrame rotation.
So just replace "CFrame.Angles" with "Vector3.new". |
|
|
| Report Abuse |
|
|
| |
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 14 Mar 2015 03:11 AM |
I'm sure you don't need parentheses.
#NoDevEggHunt |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 03:06 PM |
| switching it to vector3.new doesn't do anything different. |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2015 01:09 AM |
| Do I need to use CFrame? I don't know how rotation works with CFrame, only shifting bricks in CFrame. |
|
|
| Report Abuse |
|
|