|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|