|
| 01 Mar 2012 09:56 AM |
| How can I rotate a part to look from A to B (Like CFrame.new(A,B) but over time using BodyAngles? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 09:57 AM |
| BodyAngles..? I mean BodyAngularVelocity. Sorry. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 01 Mar 2012 11:01 AM |
Use CFrame.Angles, make a function with arguments as now and target and time, then get delta angle of it (minus the angles of now and target), divide them by time and this is your incrementing rotating of each seconds (if you give time in seconds).
I always have the psychology that you dont want to copy and past but make scripts yourself. I do want to debug for you tough ;)
|
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 01 Mar 2012 11:01 AM |
| Wait what body angles? :O Just use CFrame.Angles as I said. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 11:30 AM |
Ok, but I think I will need something else.
How can I find the rotation of a part in degrees? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 11:39 AM |
| Do I use toEulerAnglesXYZ then multiply the desired angle by 360, or do I have to divide by math.pi first? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 11:50 AM |
I need help with this script. It works fine at one side of the part, but it goes strange at the other
while wait() do dang = ({CFrame.new(workspace.Part.Position,workspace.Target.Position):toEulerAnglesXYZ()})[2] cang = ({workspace.Part.CFrame:toEulerAnglesXYZ()})[2] eang = ((dang-cang)/math.pi*360) print(eang) workspace.Part.BAV.angularvelocity = Vector3.new(0,(eang < -5 and -1 or (eang > 5 and 1 or 0)), 0) end |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 12:28 PM |
I am trying to find out what I need to multiply the Y angles axis and I currently have this script:
cf = CFrame.Angles(0,0,0) for i = 0,360 do cf=cf*CFrame.Angles(0,math.rad(1),0) print(i..": "..({cf:toEulerAnglesXYZ()})[2]/math.pi*360) end
but my output is -6.000049... for 356 |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 01 Mar 2012 12:36 PM |
| Ok. But I may in the future need to find out the 'Y' part of a CFrames angles. How can I do this? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 12:39 PM |
| I guess I would need to learn more about CFraming... How does the Rotation Matrix work? Why are there 3 numbers per rotation? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 01 Mar 2012 12:50 PM |
| So what do the thre vectors mean? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 12:50 PM |
| Three vectors in the three parts of the Rotation Matrix, I mean. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 01 Mar 2012 12:57 PM |
| So I cant find the CFrame of the brick precisly in 3 numbers? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|