|
| 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 |
|
|
|
| 31 Jan 2013 03:36 PM |
Use math.pi/# instead of actual integers.
- thedestroyer115 |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 03:42 PM |
| So I tried that and Now I have a helecopter blade. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 03:53 PM |
| What I mean by that is that it doesnt stop at 90 it keeps spinning around. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 03:55 PM |
| So your are saying that it keeps rotating and doesn't stop? |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 03:58 PM |
| yes and it gradually speeds up. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 31 Jan 2013 04:03 PM |
| Thank you! that works. I was getting scared there for a second. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 04:23 PM |
| Now how would I get it to rotate around a given point(bottom)? |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 04:36 PM |
| ok ill do it very important for cool stuff |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 04:38 PM |
| You mean like how planets revolve around the sun? |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 04:42 PM |
| no Instead of the brick rotating from the center. How would it rotate around the bottom? |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 04:44 PM |
| I don't understand what you mean when you say rotate around the bottom. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|