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: Setting a Model's CFrame?

Previous Thread :: Next Thread 
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
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
veerstrong is not online. veerstrong
Joined: 23 Jun 2009
Total Posts: 2450
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
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
04 Jan 2013 12:51 PM
Game.Workspace.Model_Name:MoveTo(Vector3/CFrame.new(#,#,#)
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
04 Jan 2013 12:55 PM
@Cody
I didn't really see any physical difference...
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
04 Jan 2013 01:24 PM
Bump.
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
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
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