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

Previous Thread :: Next Thread 
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
01 Sep 2015 09:43 PM
How would I rotate a part on its LOCAL Z-Axis with a script?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Sep 2015 09:47 PM
blah.CFrame = blah.CFrame * CFrame.Angles(0, 0, RADs)
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
01 Sep 2015 09:49 PM
Thanks!
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
01 Sep 2015 09:51 PM
local function setrotz(part,z)
local old = part.Position
part.Anchored = false
part.Position = Vector3.new(10000,10000,0)
part.RotVelocity = Vector3.new((math.random()-.5)*10,(math.random()-.5)*10,(math.random()-.5)*10)
while part.Rotation ~= Vector3.new(0,0,z) do
part.Position = part.Position + Vector3.new(0,1,0)
wait(.1)
end
part.Anchored = true
part.RotVelocity = Vector3.new(0,0,0)
part.Position = old
end
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
01 Sep 2015 09:51 PM
Now how would I apply this to a BodyRotVelocity?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
01 Sep 2015 09:54 PM
Dont use my function

What It does is at a constant rotation velocity to a part than waits until its rotation is the rotation you want it to be than returns the part back to you at the desired rotation
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
01 Sep 2015 09:56 PM
Ok, well I need a RotVelocity to rotate a part around its local Z-Axis. How would I do this?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
01 Sep 2015 09:58 PM
e.e what
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
01 Sep 2015 10:01 PM
RotVelocities = Global Axis
I want = Local Axis

How do I rotate my part around its LOCAL Z-Axis, while in GLOBAL Axis?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
01 Sep 2015 10:02 PM
RotVecloity is rotation velocity
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
01 Sep 2015 10:03 PM
You have to subtract it from the global point or whatever



part.CFrame = CFrame.new(10,10,10):ToObjectSpace(part.CFrame)
-- Caution: I have no idea what im doing here
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
01 Sep 2015 10:03 PM
Yes, I know what it is, but I need it to rotate my part around its Z-Axis. How would I do that? lookVector?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
01 Sep 2015 10:28 PM
um no

do what the first guy said
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