generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: Rotation in an If Statement

Previous Thread :: Next Thread 
luanchblox15 is not online. luanchblox15
Joined: 07 Aug 2010
Total Posts: 80
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
luanchblox15 is not online. luanchblox15
Joined: 07 Aug 2010
Total Posts: 80
13 Mar 2015 11:17 PM
Can rotation even be inside the argument of an if statement?
Report Abuse
luanchblox15 is not online. luanchblox15
Joined: 07 Aug 2010
Total Posts: 80
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 is not online. 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
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
14 Mar 2015 12:25 AM
ask scripters forum
Report Abuse
llcoolj03 is not online. 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
luanchblox15 is not online. luanchblox15
Joined: 07 Aug 2010
Total Posts: 80
14 Mar 2015 03:06 PM
switching it to vector3.new doesn't do anything different.
Report Abuse
luanchblox15 is not online. luanchblox15
Joined: 07 Aug 2010
Total Posts: 80
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image