mesh
Read mesh geometry (vertices and faces) for MeshParts, from cached URLs or by resolving a MeshPart instance.
mesh.List
Section titled “mesh.List”mesh.List() -> {string, ...}
Returns an array of all mesh content URLs currently known in the engine’s mesh cache.
for _, url in ipairs(mesh.List()) do print(url)endmesh.Get
Section titled “mesh.Get”mesh.Get(urlOrId: string) -> {url: string, vertices: {{x: number, y: number, z: number}, ...}, faces: {{number, number, number}, ...}} | nil
Fetches a mesh snapshot by exact cache URL, or by numeric asset id which matches any cached URL containing id=
local m = mesh.Get("rbxassetid://123456789")if m then print(#m.vertices, #m.faces)endmesh.OfPart
Section titled “mesh.OfPart”mesh.OfPart(part: Instance) -> {url: string, vertices: {{x: number, y: number, z: number}, ...}, faces: {{number, number, number}, ...}} | nil
Resolves the MeshId URL of a MeshPart instance and returns its mesh snapshot, or nil if the URL is empty or not in the cache.
local part = workspace.SomeMeshPartlocal m = mesh.OfPart(part)if m then print(m.url)endmesh.PartUrl
Section titled “mesh.PartUrl”mesh.PartUrl(part: Instance) -> string
Returns the raw resolved mesh content URL of a MeshPart instance, or an empty string if it has none; useful to distinguish a missing URL from a URL not yet in the cache when mesh.OfPart returns nil.
local url = mesh.PartUrl(workspace.SomeMeshPart)if url == "" then print("no mesh url")end