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 a Part off of a point

Previous Thread :: Next Thread 
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 02:12 PM
I want to rotate a Part off of a point, but I'm not sure how.

Say the Part is at (5,0,0), the point is (0,0,5), and I want to rotate the Part off of that point by math.rad(75). How would I do this?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 02:24 PM
hellooooooo
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 02:59 PM
bump
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 03:30 PM
le bumpeh
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 May 2014 03:33 PM
Point1 = Workspace.Middle.CFrame
for i=1,360 do
part.CFrame = Point1*CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,-100)
wait()
end
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 03:40 PM
So basically:

function database.Functions.RotatePartAroundPoint(part,point,angle)
local translation = point-part.Position
part.CFrame = point*angle*translation
end
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 May 2014 03:42 PM
-.-
If you knew that, why did you ask..?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 03:51 PM
I didn't know that, I based it off of what you did. Was I correct? I'm not very sure about the translation part.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 03:56 PM
Actually, what I did was wrong. Can anyone help?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 04:06 PM
Hm, would this be accurate?

function database.Functions.RotatePartAroundPoint(part,point,angle)
part.CFrame = point*angle*(point-part.CFrame.p)
end
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
31 May 2014 04:11 PM
Rotate as in make it face a certain way as well?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
31 May 2014 04:15 PM
Yes. Angle is also the offset btw.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 May 2014 05:42 PM
Rotate = function(part,StartPos,rot,distance)
part.CFrame = StartPos*CFrame.Angles(0,math.rad(rot),0)*distance
end

Rotate(Workspace.Part,Workspace.Part2.Position,5,CFrame.new(0,0,-10))


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