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 » Scripters
Home Search
 

Re: Quick question.

Previous Thread :: Next Thread 
jordanNin64 is not online. jordanNin64
Joined: 07 Jun 2013
Total Posts: 2457
11 Jul 2015 05:28 AM
How can I make a model rotate by 90 degrees?
Can you manipulate the primary part to do this?
Report Abuse
qdhxx is not online. qdhxx
Joined: 02 Jul 2010
Total Posts: 56658
11 Jul 2015 05:39 AM
probably



>mfw pro-poster http://www.roblox.com/face-item?id=241134674
Report Abuse
duckwit is not online. duckwit
Joined: 08 Aug 2008
Total Posts: 1310
11 Jul 2015 05:45 AM
ppcf = yourModel.PrimaryPart.CFrame
yourModel:SetPrimaryPartCFrame(ppcf.p + (ppcf - ppcf.p) * CFrame.Angles(0, math.pi/2, 0))

Brief explanation:
(ppcf - ppcf.p) is a cframe denoting the current rotation
(ppcf.p) is the current position
math.pi/2 is equivalent to 90 degrees (i.e. pi radians = 180 degrees)
CFrame.Angles(x,y,z) produces a rotation matrix of x radians around the x-axis (pitch), y radians around the y-axis (yaw), and z radians about the z-axis (roll).
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
11 Jul 2015 05:48 AM
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.Angles(0, math.pi/2, 0));
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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