As the title suggests, I am wondering if I can check if the selected instance is a terrain. For example:
If Part == Terrain then
return
end
As the title suggests, I am wondering if I can check if the selected instance is a terrain. For example:
If Part == Terrain then
return
end
The Instance:IsA()
method can be used to check the class of an object. Here’s an example:
local item = workspace.Part
print(item.ClassName)
if item:IsA("BasePart") then -- This condition will be met for any kind of part
-- Continue
end
To check for specific kinds of parts (such as MeshParts, Wedges, etc.), input the specific class into the method [e.g. Instance:IsA("MeshPart")
, Instance:IsA("WedgePart")
] instead of BasePart
.
What are you asking, the title says how to check if part is a terrain, but your asking how to check if the instance is a part?
I wasn’t thinking straight lol. I could’ve easily done this, thank you.
edited* I wasn’t thinking straight lol