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: .children

Previous Thread :: Next Thread 
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
01 Jul 2013 09:31 PM
There is a .Parent, what about a .Children?
Report Abuse
MrNicNac is not online. 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
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
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
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
01 Jul 2013 09:35 PM
Nope.
Don't be lazy, use a for loop.
Report Abuse
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
01 Jul 2013 09:37 PM
Alright, I guess I could use a for loop.
Report Abuse
blocco is not online. 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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
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 is not online. 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
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