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 Rotating?

Previous Thread :: Next Thread 
Juniperr is not online. Juniperr
Joined: 12 Dec 2009
Total Posts: 6094
06 Jul 2011 11:14 AM
How would I rotate a full model instead of one brick?
Report Abuse
VietnamVeteran101 is not online. VietnamVeteran101
Joined: 22 Mar 2011
Total Posts: 152
06 Jul 2011 11:17 AM
Well obviously make sure the models grouped. (It already most likely is). And secondly press "r" or use the left or right arrow symbol on the top of the screen. If its not grouped just select all the bricks and do the same.
Report Abuse
Juniperr is not online. Juniperr
Joined: 12 Dec 2009
Total Posts: 6094
06 Jul 2011 11:18 AM
Oh, no... that's not what I meant. I meant how do I CFrame a model. Sorry. :O
Report Abuse
Juniperr is not online. Juniperr
Joined: 12 Dec 2009
Total Posts: 6094
06 Jul 2011 11:23 AM
Bump
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
06 Jul 2011 11:24 AM
function ModelCFrame(Model, NewCFrame, MainModelPart)
Model:MoveTo(NewCFrame.p)
local Origins = {}
for i,v in pairs( Model:GetChildren() ) do
if v:IsA("BasePart") then
Origins[v] = MainModelPart.CFrame:toObjectSpace(v.CFrame)
end
end
for i,v in pairs( Origins ) do
i.CFrame = NewCFrame:toWorldSpace(v)
end
end


Example of usage:


ModelCFrame(
Workspace.ModelName,
CFrame.new(0,10,0) * CFrame.fromEulerAnglesXYZ(3,0,0),
Workspace.ModelName.Part
)
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
06 Jul 2011 11:25 AM
http://www.roblox.com/Forum/ShowPost.aspx?PostID=49984829

Credit to MrNicNac
Report Abuse
VietnamVeteran101 is not online. VietnamVeteran101
Joined: 22 Mar 2011
Total Posts: 152
06 Jul 2011 11:25 AM
LOL srry ! I knew something wasnt right. And srry by the way I dont know how to cframe models if its possible. I only know how to do the same as you.
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
06 Jul 2011 11:26 AM
Lol nvm.
Report Abuse
Juniperr is not online. Juniperr
Joined: 12 Dec 2009
Total Posts: 6094
06 Jul 2011 11:26 AM
Ok. Thanks!
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
06 Jul 2011 11:27 AM
The use of the MainModePart argument is obsolete, let me re-make that script...
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
06 Jul 2011 11:29 AM
Here. Just give it the model and the new CFrame:

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


--Example of usage:


ModelCFrame(
Workspace.ModelName,
CFrame.new(0,10,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
)
Report Abuse
Juniperr is not online. Juniperr
Joined: 12 Dec 2009
Total Posts: 6094
06 Jul 2011 11:29 AM
Thanks so much. That helps a ton with my script
Report Abuse
Juniperr is not online. Juniperr
Joined: 12 Dec 2009
Total Posts: 6094
06 Jul 2011 11:32 AM
Wait... There is a problem with that. The script works fine but it ends up teleporting the model somewhere and then rotating.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
06 Jul 2011 11:36 AM
Because the CFrame.new() part in the function call. Change it to the model position.
Report Abuse
Juniperr is not online. Juniperr
Joined: 12 Dec 2009
Total Posts: 6094
06 Jul 2011 11:41 AM
Ok. Thanks
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