Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 27 Apr 2014 07:42 PM |
I need to move a model. As far as I can tell, there are two ways to do this. One, make welds and just move one part. (Can't do this because there is a lot of parts and I don't know how to do welds) 2. Use the MoveTo() method. I tried this, look what happened:
Workspace.A.Value = (-56.5, 0.09, -69) Tile1.Parts:MoveTo( Workspace.A.Value + Vector3.new(0, 37.4, 0)) It ended up at 130.9, 241.59, 61. Lol?
I can't just add them together because Workspace.A will be changing. Any ideas? |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 27 Apr 2014 08:05 PM |
Bump. All the hierarchies are correct, by the way. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 27 Apr 2014 08:11 PM |
um wtf
Vector3.new is missing when you declare the workspace.A.Value |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Apr 2014 08:17 PM |
--Put in command bar, edit 'model' to name of your model and make the name different from every other model in the workspace, will create the welds for you.(Only direct children though)
model = "Put the name of the model here" Model = game.Workdpace:FindFirstChild(model) c = Model:GetChildren() bseprt = (c[math.random(1,#c)]) bseprt.Name = "Move This Part"
for i = 1,#c do w = Instance.new("Weld",c[i]) w.Part0 = w.Parent w.Part1 = bseprt end
Make every child of the model a direct child(Don't have models inside the model) and look for the part named 'Move This Part' inside the model, then move that part. |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 28 Apr 2014 08:09 PM |
So. this is my script:
Model = script.Parent c = Model:GetChildren() bseprt = script.Parent.Parent.Baseplate
for i = 1,#c do w = Instance.new("Weld",c[i]) w.Part0 = w.Parent w.Part1 = bseprt end
I get the error: "Bad cast" ? |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
| |
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 28 Apr 2014 08:46 PM |
| And looking at the wiki, what's all this stuff about C0 and C1? |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
| |
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 05:39 PM |
| But there are lots of people that move models! People use welds all the time, right? |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 05:50 PM |
Figured it out.
I had the script inside the model -it tried to weld the script. I'll just add a part filter now... |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 06:26 PM |
So the welds worked great!
So. I tried cframing part one... and the welds didn't work. The welds are all there, but the rest of the parts didn't come when I cframed.. Do I have to reset the position instead? I'll try it..
|
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 06:33 PM |
Hmmm. Resetting the position doesn't work either. What do welds do then? I thought they held parts together when they are moved. |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 07:17 PM |
Here, http://wiki.roblox.com/index.php?title=Teleportation it says to use cframe |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 07:32 PM |
I'm so lonely. I have this bad feeling nobody is helping me because the answer is super obvious.. |
|
|
| Report Abuse |
|
|
|
| 02 May 2014 07:41 PM |
| Model:MoveTo ((Model:GetModelCFrame()*CFrame.new(0,0,-studz forwards)).p) |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 07:52 PM |
I don't want to move it relative to itself. I just want to change it's position. I did some research, and I can't use MoveTo because the parent proprety of the model has to be Workspace.
References: http://wiki.roblox.com/index.php?title=Teleportation (CFrame versus MoveTo) |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 09:44 PM |
Let me rephrase my question. If you had a model that was completely welded, how would you move it? |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 02 May 2014 09:51 PM |
I figured it out. Now it's worse. The script that made the welds happened AFTER the script that moved the baseplate. Even when I did wait(15) it still waited for the script to finish before it did the welds.. |
|
|
| Report Abuse |
|
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
| |
|
Hans3229
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 109 |
|
|
| 03 May 2014 12:25 PM |
| Fine. I"ll make a new post about the order scripts go in. |
|
|
| Report Abuse |
|
|