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: Rotating Parts

Previous Thread :: Next Thread 
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
01 Mar 2012 09:57 AM
BodyAngles..? I mean BodyAngularVelocity. Sorry.
Report Abuse
jobro13 is not online. 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 is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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 is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
01 Mar 2012 12:34 PM
[ Content Deleted ]
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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 is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
01 Mar 2012 12:40 PM
[ Content Deleted ]
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
01 Mar 2012 12:50 PM
So what do the thre vectors mean?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
01 Mar 2012 12:50 PM
Three vectors in the three parts of the Rotation Matrix, I mean.
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
01 Mar 2012 12:54 PM
[ Content Deleted ]
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
01 Mar 2012 12:57 PM
So I cant find the CFrame of the brick precisly in 3 numbers?
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
01 Mar 2012 01:16 PM
[ Content Deleted ]
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