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 Platform Issue ADVANCED

Previous Thread :: Next Thread 
HunterCop224 is not online. HunterCop224
Joined: 17 Aug 2009
Total Posts: 112
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 is not online. 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 is not online. 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
HunterCop224 is not online. HunterCop224
Joined: 17 Aug 2009
Total Posts: 112
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
HunterCop224 is not online. HunterCop224
Joined: 17 Aug 2009
Total Posts: 112
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
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