|
| 28 Sep 2011 02:46 PM |
Sorry if this sounds a little noobish, but I'm having a hard time using Animinus's Model rotater, heres the script:
--[==[ TransformModel (table parts, CFrame center, CFrame new_center [, bool recurse ] )
Add this function to your script whenever you need it.
TransformModel allows you to move or rotate a group of parts, such that they will keep their relative positions to each other. You can use this to move or rotate and entire model. The first argument is a table (usually model:GetChildren()), which will contain all the parts that will be transformed. The second argument is a CFrame, which is the center of transformation. All the parts wil be transformed around this point. The third argument is another CFrame. This CFrame will become the center *after* the parts have been tranformed. For example, if the new center is 3 studs to left from the old center, all the parts will be moved 3 studs to the left.
A fourth, optional argument specifies whether the function will transform all descendants of the model.
Here's an example that rotates the entire model by 45 degrees:
local center = model:GetModelCFrame() TransformModel( model:GetChildren(), center, center * CFrame.Angles(0,math.rad(45),0), true ) ]==]
function TransformModel(objects, center, new, recurse) for _,object in pairs(objects) do if object:IsA("BasePart") then object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame)) end if recurse then TransformModel(object:GetChildren(), center, new, true) end end end
I want to have a model in the workspace(Model34) turn 45 degrees every second.... |
|
|
| Report Abuse |
|
|
myrco1001
|
  |
| Joined: 17 Sep 2010 |
| Total Posts: 2574 |
|
| |
|
|
| 28 Sep 2011 02:52 PM |
| Forum is called 'Scripting HELPERS' if you can't help, don't post, that's all there is to it. Technically that's trolling/spam. |
|
|
| Report Abuse |
|
|
myrco1001
|
  |
| Joined: 17 Sep 2010 |
| Total Posts: 2574 |
|
|
| 28 Sep 2011 02:58 PM |
I can help, you are spamming. The script explains itself, if you're too dumb to understand that then it's your fault.
-♂ MYRCO♂- Scripter, music obbsesed, atheist and dutch. What else? |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 03:18 PM |
| It does explain it, yes, I admitted that I don't understand it. I script all the time, I just hate programming vocab. |
|
|
| Report Abuse |
|
|
| |
|