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: How to move a model w/ CFrame?

Previous Thread :: Next Thread 
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
11 Oct 2013 07:14 PM
Bleh bleh haven't been on this sub-forum in AGES, and I know this question gets asked like every 5 minutes, but when you search the question on Google it just comes up with videos of people giving mediocre tutorials on how to CFrame.
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
11 Oct 2013 07:15 PM
:getModelCFrame();
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
11 Oct 2013 07:16 PM
That returns the model's CFrame, it doesnt allow you to edit it.
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
11 Oct 2013 07:17 PM
Yes it does.
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
11 Oct 2013 07:18 PM
^
Can you elaborate?
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
11 Oct 2013 07:44 PM
Of course you can't, because you cant CFrame a model with that method.
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
11 Oct 2013 07:45 PM
I have a model CF-Editor

model:MoveTo(Vector3.new(x, y, z))
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
11 Oct 2013 07:50 PM
Okay, let me explain better:
How can I rotate a model with a script?
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
11 Oct 2013 07:52 PM
for i,obj in pairs(workspace.model:GetChildren()) do
if obj:IsA("BasePart") then
obj.CFrame = obj.CFrame + CFrame.new(0, 0, 0)
end
end
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
11 Oct 2013 07:54 PM
function RotateModel(Model,Angles)
local a=Angles
for i,v in pairs(Model:GetChildren()) do
if v:IsA("Part") then
v.CFrame=v.CFrame*a
else RotateModel(v,a)
end
end
end

RotateModel(Model,CFrame.Angles(10,10,10))

Like that?
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
11 Oct 2013 07:54 PM
Replace Part with BasePart sowwy
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
11 Oct 2013 07:57 PM
x = CFrame.new(0, 1, 0)
for i, pos in pairs(game.Workspace.Model:GetChildren())
do if pos:IsA("Model") then
pos.CFrame = pos.CFrame + x
end
end
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
11 Oct 2013 07:58 PM
Yeah dude BasePart is more on wedges, truss etc.
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
11 Oct 2013 07:59 PM
@GG

No you CFrame'd the model not the model parts.
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
11 Oct 2013 08:01 PM
Thanks.
I'm glad to see that all of the users on tihs subforum as of late aren't obnoxious as stephen.
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
11 Oct 2013 08:05 PM
However, to rotate a model, you'd have to do more than just rotate each part in a direction individually, you have to make each part picot around a certain point, and I have no idea how to do that.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
11 Oct 2013 08:44 PM
dog, MoveTo changes it like position, it checks for collision detection.

You would have to use simple subtraction from the CFrame of where you are and use TranslateBy
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