|
| 25 Mar 2015 02:17 PM |
| What does parent mean? (According to scripting) |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:18 PM |
The Child's Parent
like.. Model.Parent is game.Workspace because Model is INSIDE the Workspace
Total Posts: 404 ---------- Not Found |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:18 PM |
What the object is descended from.
-Workspace --BasePlate
BasePlate's parent is Workspace. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:19 PM |
An example of a parent is a script in a brick. The brick is the parent. Think of it like your family -- Your parents are the parent of you. Another good comparison is folders. The folder is the parent of everything that's inside of it.
Hope this helped! |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 25 Mar 2015 02:19 PM |
The parent of an instance is one of the instances that contains it. In terms of scripting it is the instance directly above the instance in question.
I know it's confusing, but look at this.
game --Workspace ----Part
Workspace is the parent of Part, and game is the parent of Workspace. Workspace is directly in game, and Part is directly in Workspace.
However, game is still a parent of Part. Just an indirect one. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:30 PM |
| game would be an ancester of part, and can also be likened to the root folder, and all the instances ("children") inside are subfolders. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:31 PM |
| Wow, you're a scripting god, Samaraandsonic. Can't believe it! |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:33 PM |
Example: Model of a car. There are bricks inside the model. Model is parent of the bricks. Bricks are the children of the model. SSSSIIIIIIIIIMMMMMMMMMPPPPPLLLLLLLEEEEEEEEEEEEEEEEE |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 25 Mar 2015 02:36 PM |
| A Parent is someone who raises you. Duh. |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
| |
|
|
| 25 Mar 2015 02:39 PM |
What a Parent is on Roblox.
How grouping works on Roblox is that, well, you can put stuff inside other stuff. Not physically, not like a brick inside another brick. So:
Parent is the object above another object
TestExampleOne | |--Potato | |--Triangle | |--Luna_Is_Best_Pony | |--AnotherExample | |--Sock |
The parent of 'Sock' is 'AnotherExample'. The parent of 'AnotherExample' is 'TestExampleOne'. The parent of 'Potato' is 'TestExampleOne'. I didn't list all the items, but you should get the idea. That is the essence of what a "Parent" is in coding.
Copied from another post I made: http://www.roblox.com/Forum/ShowPost.aspx?PostID=158582621
|
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:41 PM |
| In simplest form its what the "object/item" is inside of. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 25 Mar 2015 08:20 PM |
| @Roblok1 you obviously have no idea what sarcasm is, idiot. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 25 Mar 2015 08:59 PM |
ROBLOX has a hierarchy system.
Everything that is the game is, is called game. Everything that has a physical form is in the Workspace, which is in the game. ROBLOX's hierarchy system uses dot notation, so to get the Workspace you say:
game.Workspace
Now lets say you have a part in your game, and it is called 'Part1'. To get the Part via script, you say:
game.Workspace.Part1
The parent of Part1, is the Workspace, and the parent of Workspace, is game.
With this, you could alter the properties of the Part, here is an example:
game.Workspace.Part1.Transparency = 0.5
Note: Transparency is a property.
What if you were so excited and wanted two see-through parts? You copy and paste 'Part1'. Only one of the parts appears transparent. The reason is they both have the same name.
A way around this, is to put the Script inside the part.
Scripts have a special keyword to refer to themselves called 'script'. If you said:
print(script.Name)
it would print whatever the name of the current script you are typing it in is.
Because the script is inside the part, the hierarchy is now:
game.Workspace.Part1.Script
however, because there are 2 'Part1' objects, so that won't work.
This is where we use the special keyword 'script'. Because the parent of script is the Part, to get the Part, we can simply say:
script.Parent
and alter it the same
script.Parent.Transparency = 0.5 |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 25 Mar 2015 09:01 PM |
| however, because there are 2 'Part1' objects, that won't work.* |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 25 Mar 2015 09:01 PM |
| i dont think it took 13 people to answer such a simple question |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 25 Mar 2015 09:03 PM |
Apparently it did. I said everything that needed to be said, and hardly of any of it was said before me.
It shouldn't take 13 people to answer such a simple question, but it did.
Go team. |
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 25 Mar 2015 09:09 PM |
| Nope Your All Wrong A Parent Is The Original Creater For Example print(game.Players.LocalPlayer) = Player.PlayerConnect Cause when u call PlayerConnect in The C Side It Calls CreateLocalPlayer And A Child Is Something Created For Example . GetChildren(Player.PlayerConnect) -> {You Player } Then A Descendent Is An Object In An Object And An Ancester Is Above So If U need The Level 1 Ancestor Just Get Ancestors Its The [1] Result . Hope This Helped ! Good Wishe's <3 |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 25 Mar 2015 09:09 PM |
ehh, you said an over abundance could've just said a parent is whatever an instance derives from she probably wouldn't have gotten it, though lol
-=Robo=- |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 25 Mar 2015 09:15 PM |
| I would of done better to narrate my own YouTube tutorial on the ROBLOX hierarchy. However I think I did well on explaining it. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 09:18 PM |
a parent is basically what owns another thing so let's say we have a part, and we add fire to it the fire is the child, and the part is the parent another example is: if we insert a part into Workspace (The place bricks and parts and such are seen) the part's parent is now Workspace |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 25 Mar 2015 09:18 PM |
the question is answered please stop
-=Robo=- |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 25 Mar 2015 09:22 PM |
| "how many scripters does it take to answer the meaning of parent?" |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 09:25 PM |
I want to take my part, although ~20 others have already answered. Hard to explain, but I'll try,
Say, we have a family. The mom and dad are the 'main' bases, or Workspace, like in ROBLOX. This is the parent. The child is the part in Workspace, or the mom and dad's son/daughter. This is what is in Parent.
Here's a descriptive version.
Game (what everything is put in, nothing can be the parent of this, since it is the parent of everything else.) - Workspace (what any physical object is put in, the child, or descendant of Game, parent of Part.) -- Part (the child, or descendant of Workspace, parent of Script) --- Script (the child, or descendant of Part)
It's like a branch with leaves. The leaves are the branches' child. The branch is the parent of the leaves. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 25 Mar 2015 09:25 PM |
| Beginners flock to the easy ones because they feel so good they finally know the answer to a question here. |
|
|
| Report Abuse |
|
|