zappy00
|
  |
| Joined: 02 May 2009 |
| Total Posts: 7091 |
|
|
| 12 Jul 2012 01:21 PM |
Let's say there's a cube that is made out of other tiny cubes. The little cubes are anchored, but need to be unanchored when a button is clicked.
How do I use the getchildren method or function in this case so they all become unanchored all together? I don't want to assign a variable to every single little cube. |
|
|
| Report Abuse |
|
|
jaydan1
|
  |
| Joined: 13 Jan 2010 |
| Total Posts: 128 |
|
|
| 12 Jul 2012 01:24 PM |
for i,v in pairs(game.Workspace.Cubes:GetChildren()) do v.Ancored = false end |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 12 Jul 2012 01:28 PM |
@jayden
1. Spelled Anchored wrong.
2. What if the value is not a part and doesn't have a property Anchored hmm?
for i,v in pairs(game.Workspace.Cubes:GetChildren()) do if v:IsA("Part") then v.Anchored = true end end
|
|
|
| Report Abuse |
|
|
zappy00
|
  |
| Joined: 02 May 2009 |
| Total Posts: 7091 |
|
|
| 12 Jul 2012 01:47 PM |
| Thank you so much. ^_^ Both |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 12 Jul 2012 01:55 PM |
| Miz I have to correct you, you put anchored is true not false dumdum |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 12 Jul 2012 02:02 PM |
| So? He could change the booleans if he wanted. |
|
|
| Report Abuse |
|
|