|
| 27 May 2012 08:33 PM |
I am trying to make a spinning platform that contains about 40 parts that are cfamed into a circle, I need this to slowly spin clockwise, however, every method that I have tried does not work.
I can't use the motor surface because it's to heavy. I can't use a motor object (one like a weld), because the graphics aren't refreshing so it looks like its still, this is very hard to explain, long story short it doesn't work. I can't use a weld and have the rotation make it spin, same issue as the motor. I can't use a BodyAngularVelocity, because it would tilt, and it's still too heavy.
It would be perfect if there was a script that got the positions of all of the parts and slowly moves and rotates them to look like its spinning (I'm working on this now), If you have even the slightest idea on how to fix this, please tell me, I need this fixed.
Thanks in advance, HunterCop224
Here is a link to the place with the cframed circle : http://www.roblox.com/Random-place?id=25027528 |
|
|
| Report Abuse |
|
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 27 May 2012 08:38 PM |
I used this to rotate my model, it "Skips" straight from it's current rotation degree to 90. But adding an for in the will rotate slowly.
function rotateMod(mod,center,rotation) local parts ={} local function scan(parent) for _,obj in pairs(parent:GetChildren()) do if (obj:IsA("BasePart")) then table.insert(parts,obj) end scan(obj) end end scan(mod) for _,part in pairs(parts) do part.CFrame = (center*rotation*(center:inverse()*part.CFrame)) end end
local mod = script.Parent local center = script.Parent.centerPart
rotateMod(mod,center.CFrame,CFrame.Angles(0,math.rad(90),0))
MrMcAero |
|
|
| Report Abuse |
|
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 27 May 2012 08:39 PM |
for i=1,90 do rotateMod(mod,center.CFrame,CFrame.Angles(0,math.rad(1),0)) end
That's for 1 deg rotation 90 times.
MrMcAero |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 09:21 PM |
Line 13, where the part cframed is set, does not work, I don't know if this script is old, but cframes are like vector3 and need to be treated like this:
Part.CFrame = Vector3.new(0, 0, 0) * CFrame.formEulerAnglesXYZ(0, 0, 0)
I read the script, and everything but the CFrame assignment looks like it should work. |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 09:29 PM |
| Never mind, got it fixed, I need to learn a bit more about this stuff, thank you so much. |
|
|
| Report Abuse |
|
|