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: Model Rotation

Previous Thread :: Next Thread 
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
25 Jul 2013 05:14 AM
im still confused CFrames and everything.

can someone give me a bit of code that would rotate a model and explain how it works?
Report Abuse
Nikilis is online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
25 Jul 2013 05:20 AM
http://wiki.roblox.com/index.php/CFraming
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
25 Jul 2013 06:52 AM
while true do
for _, part in next,script.Parent.Parent:GetChildren() do
part.CFrame=part.CFrame*CFrame.new(0,0,0)*CFrame.Angles(math.rad(10),math.rad(10),math.rad(10))
end
wait(0.1)
end


so i made this and it rotates each part of the model and not the model itself

help please.
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
25 Jul 2013 07:25 AM
BUMP
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
25 Jul 2013 08:19 AM
    --By xXxMoNkEyMaNxXx
    local function get(t,i)
        return t[i]
    end
    local function set(t,i,v)
        t[i]=v
    end
    local function MulCFrame(obj,cf)
        local hasCFrame,CFrame=pcall(get,obj,"CFrame")
        if hasCFrame then
            pcall(set,obj,"CFrame",cf*CFrame)
        end
        for _,child in next,obj:GetChildren() do
            MulCFrame(child,cf)
        end
    end
    function SetModelCFrame(model,CFrame)
        MulCFrame(model,CFrame*model:GetModelCFrame():inverse())
    end

Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
25 Jul 2013 09:08 AM
its fine i used anaminus' code for this ( not written by him but still )

ty anyway
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