Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does GetFullName() also get the parent of the name?

-- 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

1 answer

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:

local Model = Instance.new("Model",workspace)
local Part = Instance.new("Part",Model)

print(Part:GetFullName()) --> game.Workspace.Model.Part

print(Part.Name) --> Part

print(Part.Parent.Name) --> Model

print(Part.Parent.Parent.Name) --> Workspace

print(Part.Parent:GetFullName()) --> game.Workspace.Model

-Edit- Added examples to make answer more clear.

This discussion is preserved as it was. New answers, comments, and votes are closed.