Created
May 18, 2025 06:38
-
-
Save Finchasaurus/6cfc6dd862ae3c11befa080e9ceaa151 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- When I was first looking at the APIs I refered to the devforum posts lmao | |
| -- https://devforum.roblox.com/t/studio-beta-major-updates-to-in-experience-mesh-image-apis/3225681 | |
| -- https://devforum.roblox.com/t/client-beta-in-experience-mesh-image-apis-now-available-in-published-experiences/3267293 | |
| local AssetService = game:GetService("AssetService") | |
| -- Creating a simple triangle | |
| local editableMesh = AssetService:CreateEditableMesh() | |
| local v1 = editableMesh:AddVertex(Vector3.new(0, 1, 0)) | |
| local v2 = editableMesh:AddVertex(Vector3.new(1, 0, 0)) | |
| local v3 = editableMesh:AddVertex(Vector3.new(-1, 0, 0)) | |
| editableMesh:AddTriangle(v1, v2, v3) | |
| -- Create mesh part from the editable mesh | |
| local createdMeshPart = AssetService:CreateMeshPartAsync(Content.fromObject(editableMesh)) | |
| createdMeshPart.Name = "created" | |
| createdMeshPart.Anchored = true | |
| createdMeshPart.Parent = workspace | |
| -- Apply created mesh part to another mesh part | |
| local existingMeshPart = Instance.new("MeshPart") | |
| existingMeshPart.Name = "existing" | |
| existingMeshPart.Anchored = true | |
| existingMeshPart.Parent = workspace | |
| existingMeshPart:ApplyMesh(createdMeshPart) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment