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: :MoveTo()

Previous Thread :: Next Thread 
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
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 is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
25 Dec 2011 09:15 PM
I believe it's the model itself.
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
25 Dec 2011 09:17 PM
So it won't disfigure the model?


Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
25 Dec 2011 09:20 PM
Disfigure?
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
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 is not online. 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
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
25 Dec 2011 09:35 PM
Nope. Would that create the same effect?
Report Abuse
superman40 is not online. superman40
Joined: 02 Feb 2009
Total Posts: 41
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
Willingroblox123 is not online. Willingroblox123
Joined: 18 Jan 2010
Total Posts: 6872
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
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
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 is not online. 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 is not online. 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
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
26 Dec 2011 11:11 AM
Thanks. That is exactly what I wanted.
Report Abuse
dennisvdz is not online. 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
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
26 Dec 2011 11:45 AM
Does that disfigure the model?

~Trappee?Trapper~
Report Abuse
xvgigakid is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
26 Dec 2011 11:56 AM
And then there was 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