ClassName (Property): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mr Doom Bringer
No edit summary
>Legend26
No edit summary
 
(45 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Property|
{{ReadOnly}}
name = className
 
|property = [[Instance]] ''class''
<onlyinclude>{{Property
|description = The object's class; what the object is.
|name       = ClassName
|object = Global
|type        = {{type|string}}
|}}
|description = A unique string per type of Instance. Should only be used as a unique identifier, as it does not reveal any information about nature of the type hierarchy the type is in. For this use, see [[IsA]].
|object     = Instance
}}</onlyinclude>
 
{{clear floats}}
 
{{Example|<pre>
for _, child in ipairs(part:GetChildren()) do
    if child.ClassName == 'Part' then
        -- will find Parts, but NOT TrussParts, WedgeParts, and other part-like objects
    end
end
</pre>}}
 
[[Category:Properties]]

Latest revision as of 20:10, 6 April 2012

This is a read-only property. It cannot be written to, only read.
ClassName
Type string
Description A unique string per type of Instance. Should only be used as a unique identifier, as it does not reveal any information about nature of the type hierarchy the type is in. For this use, see IsA.
Member of Instance


Example
for _, child in ipairs(part:GetChildren()) do
    if child.ClassName == 'Part' then
        -- will find Parts, but NOT TrussParts, WedgeParts, and other part-like objects
    end
end