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 » Scripting Helpers
Home Search
 

Re: How do I rotate a part?

Previous Thread :: Next Thread 
Cobblestoner is not online. Cobblestoner
Joined: 01 Jan 2012
Total Posts: 70
08 Feb 2012 04:29 PM
How would I go about rotating a part on the world's x axis as opposed to rotating a part on it's own x axis?
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
08 Feb 2012 04:39 PM
I have no idea if this works, I just guessed... It probably won't work, but I'm sure it's something like this.

    local Part = Workspace.Part
    
    local CurrentAngle = CFrame.fromEulerAnglesXYZ( Part.CFrame:toEulerAnglesXYZ() )
    local Rotation = CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
    
    Part.CFrame = CurrentAngle * Rotation * Part.Position

▌†ηϨ▐
Report Abuse
Cobblestoner is not online. Cobblestoner
Joined: 01 Jan 2012
Total Posts: 70
08 Feb 2012 06:04 PM
Kind of looks like a bunch of made up stuff. All legitimate methods, but I've tried random stuff like this and the part just rotates weirdly. Anyone else have some experience with rotations and what not?
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Feb 2012 06:11 PM
    local part=workspace.Part;
    
    Part.CFrame=CFrame.Angles(math.rad(90),0,0)*Part.CFrame;
Report Abuse
Cobblestoner is not online. Cobblestoner
Joined: 01 Jan 2012
Total Posts: 70
08 Feb 2012 06:15 PM
Is that going to rotate the part on the world's x axis? Because when I did that it didn't.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Feb 2012 06:18 PM
If you mean rotate it around the X-axis as in like spin it around then yes, that should work. Otherwise I don't understand what you're saying.
Report Abuse
Cobblestoner is not online. Cobblestoner
Joined: 01 Jan 2012
Total Posts: 70
08 Feb 2012 06:23 PM
If you have a part tilted 45 degrees on the y axis, and then rotated the part 45 degrees on the x axis, it would be rotated differently than if you rotated it on the world's x axis.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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