|
| 04 Jan 2013 12:48 PM |
| Hi guys, I know you can get a models CFrame by using GetModelCFrame() but is it possible to set it? I would like to know this as I am doing a random map script and I feel the maps might go out of place. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 12:50 PM |
You can either do some confusing CFraming with it, by use GetWorldSpace() blah blah blah
Or you could possible just loop through everything and cframe it |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 12:51 PM |
| Game.Workspace.Model_Name:MoveTo(Vector3/CFrame.new(#,#,#) |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 12:55 PM |
@Cody I didn't really see any physical difference... |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jan 2013 01:30 PM |
local SetCFrame = function(model,cf) local function recursive_set(obj,modcf,cf) if obj:IsA("BasePart") then obj.CFrame = cf:toWorldSpace(modcf:toObjectSpace(obj.CFrame)) end for _,child in next,obj:GetChildren() do recursive_set(child,modcf,cf) end end recursive_set(model,model:GetModelCFrame(),cf) end
credit xxxmonkeymanxxx. pulled this off another thread it's quite interesting when you dissect it.
¬ LuaLearners Elite/Writer |
|
|
| Report Abuse |
|
|