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: How do I set the rotation of a model?

Previous Thread :: Next Thread 
H1998 is not online. H1998
Joined: 30 Mar 2009
Total Posts: 3336
20 May 2013 08:00 AM
The MoveTo method only allows to set the position. What is the best way to rotate the entire model by script?
Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
20 May 2013 08:07 AM
fromEulerAnglesXYZ

http://wiki.roblox.com/index.php/CFrame

Soup's on, everybody!
~LuaLearners Writer~
Report Abuse
H1998 is not online. H1998
Joined: 30 Mar 2009
Total Posts: 3336
20 May 2013 08:16 AM
Why are you telling me this? I have already been to that page dozens of times and nothing tells about rotating ENTIRE MODELS. Rotating them the same way you would in studio!
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
20 May 2013 08:49 AM
function ModelCFrame(Model, NewCFrame)
Model:MoveTo(NewCFrame.p)
local Origins = {}
for i,v in pairs( Model:GetChildren() ) do
if v:IsA("BasePart") then
Origins[v] = Model:GetModelCFrame():toObjectSpace(v.CFrame)
end
end
for i,v in pairs( Origins ) do
i.CFrame = NewCFrame:toWorldSpace(v)
end
end

ModelCFrame(Workspace.Model, CFrame.Angles(1,0,1))
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
20 May 2013 09:54 AM
The torso is welded to all the limbs, just change the torso's CFrame.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
20 May 2013 09:55 AM
@mr

shes talking about models not players.
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
20 May 2013 09:59 AM
I'm half asleep and not paying much attention, sorry.
Report Abuse
slyguynl is not online. slyguynl
Joined: 28 Mar 2009
Total Posts: 20
20 May 2013 01:51 PM
@pokemon

obviously h1 is as much of a girl as i am :)
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