How to check if part is a terrain

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.

Resources

Instance:IsA() Method - Creator Documentation

BasePart Class - Creator Documentation

1 Like

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?

1 Like

I wasn’t thinking straight lol. I could’ve easily done this, thank you.

1 Like

edited* I wasn’t thinking straight lol

1 Like