|
| 01 Jul 2013 09:31 PM |
| There is a .Parent, what about a .Children? |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 01 Jul 2013 09:32 PM |
Children can be obtained through a function as a table.
Object:GetChildren()
|
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 09:34 PM |
| I know, but to act on all of them you will have to use a for statement and that does them seperate in a loop. |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 09:35 PM |
Nope. Don't be lazy, use a for loop. |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 09:37 PM |
| Alright, I guess I could use a for loop. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 01 Jul 2013 09:38 PM |
| You could always go old school and you table.foreach, or write your own iterator, or do cool stuff that no one things of, like making syntactic sugar with that iterator. |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 09:58 PM |
| There can't be a children property because any object might have more than one child, while every object has only one parent. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 01 Jul 2013 10:00 PM |
It's actually very possible to have a children property. It's just not practical.
By making it a property, Roblox would have to update it every time a child was added! Yuck! By making it a method, Roblox doesn't have to update it, and you can generate a copy of the object's children at your desire. Much better. |
|
|
| Report Abuse |
|
|