|
| 29 Oct 2013 05:58 PM |
I want to rotate a cframe to a blorh radian angle, but smoothly. How would i do this?
If I do Blah.CFrame * CFrame.Angles(0,0,Bleh) it will move smoothly, but will go forever.
If I try to stop this by using CFrame:toEulerAnglesXYZ().Z and checking to ensure that it is not rotated beyond Blorh, it will error.
Why is this, and is there a different method I could use? |
|
|
| Report Abuse |
|
|
Pillaged
|
  |
| Joined: 14 Jul 2013 |
| Total Posts: 59 |
|
|
| 29 Oct 2013 05:59 PM |
| Do a ton of those CFrame.Angles things OR use motors. |
|
|
| Report Abuse |
|
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 29 Oct 2013 06:03 PM |
Here's the most fun (and coincidentally, the most accurate) method you can do: http://wiki.roblox.com/index.php/User:XLEGOx/quaternioninterpolate
I also have an example (made from scratch) at my place that uses the same concept of quaternions. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 06:03 PM |
@Pillaged
I'm trying to stop rotating at a specific radian.
so like this:
while wait() do if CFrame is rotated on Z axis less than 2 radians then cframe = cframe * cframe.ankles(0,0,0.01) end end
I'm trying to figure out what to put in that if statement |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 29 Oct 2013 06:08 PM |
@cntpleasebygodkillme
Pseduocode only needs to make sense |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 29 Oct 2013 06:13 PM |
| I don't think OP read what I posted... |
|
|
| Report Abuse |
|
|