-- Also when using the GetFullName() function, why does it get the parent of the instance too For example game:GetFullName() >>>>> game workspace:GetFullName() >>>>> game.workspace
Why does it also get the game, which is the parent, instead of only the name"workspace"
-- Is there a way of getting the name of the "workspace" without having the parent before? which in this case, is game
Instance:GetFullName() Get's the FULL path to the Instance.
Instance.Name gets the Name of the Instance.
Instance.Parent.Name gets the Instance's Parent name.
Examples:
01 | local Model = Instance.new( "Model" ,workspace) |
02 | local Part = Instance.new( "Part" ,Model) |
03 |
04 | print (Part:GetFullName()) --> game.Workspace.Model.Part |
05 |
06 | print (Part.Name) --> Part |
07 |
08 | print (Part.Parent.Name) --> Model |
09 |
10 | print (Part.Parent.Parent.Name) --> Workspace |
11 |
12 | print (Part.Parent:GetFullName()) --> game.Workspace.Model |
-Edit- Added examples to make answer more clear.