|
| 25 Dec 2011 09:06 PM |
| If you use :MoveTo() on a model, will it move ALL of it's children to that location, or the model itself. What I mean is, if you use MoveTo, are all the models children set to the same Position? Or will it move all the children to another position, but all the pieces still look the way they should? |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 25 Dec 2011 09:15 PM |
| I believe it's the model itself. |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2011 09:17 PM |
So it won't disfigure the model?
|
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
| |
|
|
| 25 Dec 2011 09:22 PM |
| I have been running into trouble with CFrame... If I set all the objects to change to the new position, ALL the parts are all at one point, making the model useless. If all the parts are at the same point, then you can not tell what the model is. That is what I mean by disfigure. |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 25 Dec 2011 09:27 PM |
Are you using this? game.Workspace.Model:MoveTo(Vector3.new(0,0,0)) ? |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2011 09:35 PM |
| Nope. Would that create the same effect? |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2011 10:11 PM |
Well, wouldn't it be simpler to do: for _, v in ipairs(modelName:getChildren()) if v:isA("BasePart") then v.CFrame = CFrame.new(v.Position.x + numberofstudsaway, v.Position.y + numberofstudsaway, v.Position.z + numberofstudsaway) end end
*NOTE* Made on the fl, might need editing. |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2011 10:17 PM |
:MoveTo() moves the model it's self, not the children all to the same spot, is this answering your question?
~GD~ ~Idea Scale~ ~Idea Support|Overused Idea|Full Support~ |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2011 10:27 PM |
A model has no position, so how does it move the 'Model' but not it's children?
|
|
|
| Report Abuse |
|
|
CrasyTrex
|
  |
| Joined: 13 Mar 2011 |
| Total Posts: 761 |
|
|
| 25 Dec 2011 10:51 PM |
| It moves the entire model and it makes the center point in the coordinates. The children move but are not in the same coordinate that was put in the :MoveTo(). |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 26 Dec 2011 12:19 AM |
| When you select a model, a blue "bounding box" will show up. MoveTo() moves the model in such a way that the exact center of that bounding box is at the given coordinates. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2011 11:11 AM |
| Thanks. That is exactly what I wanted. |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 11:43 AM |
| It does NOT move the whole model according to it's center position, as far as I've experienced, however, it moves according to it's primary part, or biggest one. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2011 11:45 AM |
Does that disfigure the model?
~Trappee?Trapper~ |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 26 Dec 2011 11:47 AM |
@Trapper
MoveTo() moves the entire model. That means all its children. When you say the model itself it refers to the model and all of its children. A better way to have put this is by saying the model instance.
You could use it like this
Model:MoveTo(Vector3.new(x,y,z)) |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 11:47 AM |
No. You can set a model's primary part like this:
workspace.Model.PrimaryPart = workspace.Model.ThisIsPrimary (or in Studio there is some button for it)
Then when you use
workspace.Model:MoveTo(..) it'll mode ThisIsPrimary to the position between the brackets. All other things inside the model will stick along with ThisIsPrimary, they do not disform it. |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 26 Dec 2011 11:48 AM |
@Dennis
If you have a primary part it will move it accordingly to it. But if there is no primary it will move it to the center of the model. |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 11:54 AM |
| Not really, it'll move to the firstly created part of that model (that is actually the automatically assigned PrimaryPart). |
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
|
| 26 Dec 2011 11:56 AM |
| And then there was TranslateBy(). |
|
|
| Report Abuse |
|
|