miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 11:13 AM |
while true do for i,v in pairs(script.Parent:GetChildren()) do for i = 1,25 do wait() v.Position = Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0) end end end It moves but it' a model. I want the whole model to move together.
|
|
|
| Report Abuse |
|
|
|
| 22 Oct 2011 11:15 AM |
Don't trust me?
I said use Model:TranslateBy() |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2011 11:15 AM |
while true do for i,v in pairs(script.Parent:GetChildren()) do for i = 1, 25 do wait() v.move( Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0)) end end end That should work if not sorreh. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 11:17 AM |
Josh
I know your trying but...no...
@Darkmist
I never heard that :P I'm new to that. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 11:18 AM |
@Darkmist
You mean this?
v:TranslateBy (Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0)
|
|
|
| Report Abuse |
|
|
|
| 22 Oct 2011 11:18 AM |
Shifts a model using its offset. This will shift a model over 10 studs.
game.Workspace.Model:TranslateBy(Vector3.new(10, 0, 0))
|
|
|
| Report Abuse |
|
|
|
| 22 Oct 2011 11:19 AM |
@miz,
How am I supposed to know, The only knowledge I have is copy and paste :D |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2011 11:20 AM |
| But if it's alrerady grouped into a model you can take the pairs out and just tag the whole model with a varieable and use the move function? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2011 11:24 AM |
| This would work right miz? cause ive been using the move function alot and it's been working for me with moving models. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 22 Oct 2011 11:27 AM |
The model doesn't have a move() function... it has a MoveTo() function?
while true do for i = 1,25 do wait() script.Parent:MoveTo(Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0)) end end
The issue with the original script was you structured your loops wrong.
You had it go through every brick in the model and move it up 25 studs. You wanted it to move the model up 25 studs, moving the model as one.
Since that explanation was indecipherable - this is what the script would've looked like.
while true do for i = 1,25 do wait() for i,v in pairs(script.Parent:GetChildren()) do v.Position = Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0) end end end |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2011 11:29 AM |
| @ ^ either way lol move() woulden't work but the moveto should |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 11:32 AM |
@Swaniac
That's what I've been trying to tell josh.
Also, that just moved to a position. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 22 Oct 2011 11:34 AM |
My script should work,
while true do for i = 1,25 do wait() for i,v in pairs(script.Parent:GetChildren()) do v.Position = Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0) end end end
This one wouldn't, in retrospect, because the script would hit a non-brick object and break. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 11:36 AM |
And @Swmaniac
When I tried saying game.Workspace.Witch:GetChildren() only 2 of the parts moved and they just spazzmed. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 22 Oct 2011 11:37 AM |
You used this?
while true do for i = 1,25 do wait() workspace.Witch:MoveTo(Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0)) end end |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 11:37 AM |
@Swmaniac
When I tried that this is the output
Position is not a valid member of Script
Which makes sense. So I've tried saying game.Workspace but only 2 parts moved. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 22 Oct 2011 11:39 AM |
My script never uses Position, you're not using this: while true do for i = 1,25 do wait() script.Parent:MoveTo(Vector3.new(-179.7, 4.36, 82.5) + Vector3.new(i, 0, 0)) end end |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 11:40 AM |
@swmaniac
Thanks! That worked! I just got confused because darkmist said to use
model:TranslateBy()
And I've never heard that. But thanks! |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 22 Oct 2011 11:42 AM |
This would be how TranslateBy() works
function Model:TranslateBy(Vector3 delta) self:MoveTo(self:GetModelCFrame.p + delta) end
Or if you can't read pseudo-code, it moves the model in relation to its current position. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 22 Oct 2011 11:46 AM |
| It's just how far the person calling TranslateBy() wants the model to move. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2011 12:15 PM |
| Mkay I see now. I KINDA get it but thanks! |
|
|
| Report Abuse |
|
|