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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 6094 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 22 Aug 2008 |
| Total Posts: 832 |
|
| |
|
Juniperr
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 6094 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 6094 |
|
| |
|