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: CFrame Angles

Previous Thread :: Next Thread 
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 03:35 PM
Alright so I want a brick to rotate to 90 degrees from its current position. I want it be slowed down so that it doesn't just jump to 90. Every time I try to do it it fails and jumps all over the place. Whats wrong with this script?

for i = 0, 90,1 do
local part = Workspace.Part
part.CFrame = part.CFrame * CFrame.Angles(0, i, 0)
wait()
end
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
31 Jan 2013 03:36 PM
Use math.pi/# instead of actual integers.

- thedestroyer115
Report Abuse
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 03:42 PM
So I tried that and Now I have a helecopter blade.
Report Abuse
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 03:53 PM
What I mean by that is that it doesnt stop at 90 it keeps spinning around.
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 03:55 PM
So your are saying that it keeps rotating and doesn't stop?
Report Abuse
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 03:58 PM
yes and it gradually speeds up.
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 04:00 PM
Try this:

for i=1, 90 do
local part = Workspace.Part
part.CFrame = part.CFrame * CFrame.Angles(0, math.rad(1), 0)
wait()
end
Report Abuse
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 04:03 PM
Thank you! that works. I was getting scared there for a second.
Report Abuse
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 04:23 PM
Now how would I get it to rotate around a given point(bottom)?
Report Abuse
xvxvpredator101 is not online. xvxvpredator101
Joined: 19 Apr 2012
Total Posts: 2059
31 Jan 2013 04:36 PM
ok ill do it very important for cool stuff
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 04:38 PM
You mean like how planets revolve around the sun?
Report Abuse
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 04:42 PM
no Instead of the brick rotating from the center. How would it rotate around the bottom?
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 04:44 PM
I don't understand what you mean when you say rotate around the bottom.
Report Abuse
LastHunterRemix is not online. LastHunterRemix
Joined: 08 Jan 2013
Total Posts: 70
31 Jan 2013 04:52 PM
you know that if you want to make a door without scripting you make 2 blocks that have one side that are hinges then you put an non-anchored part there. Then when someone pushes on the door it will rotate at the hinges where ever they may be. thats what i want with the rotating but instead of making it so that the brick levels out onto the ground, it rotates from the center of the brick and is floating in the air. btw the basic concept is that of the door in real life. how the door pivots on the hinge not the middle but apply that to and draw bridge.
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 05:01 PM
local pivpos = Vector3.new(0,0,0)
local brdigepos = workspace.Bridge.CFrame
local dist = (bridgepos.p - pivpos).magnitude
for i=1, 90 do
workspace.Bridge.CFrame = workspace.Bridge.CFrame * CFrame.new(0,math.rad(1),0)
workspace.Bridge.CFrame = bridgepos * CFrame.new(bridgepos.p.X,dist*math.cos(math.rad(i)),math.sin(math.rad(i)))
wait()
end

-- Might not work, but try this.
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 05:04 PM
local pivpos = Vector3.new(0,0,0)
local brdigepos = workspace.Bridge.CFrame
local dist = (bridgepos.p - pivpos).magnitude
for i=1, 90 do
workspace.Bridge.CFrame = bridgepos * CFrame.new(0,math.rad(i),0) * CFrame.new(bridgepos.p.X,dist*math.cos(math.rad(i)),math.sin(math.rad(i)))
wait()
end
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