So basically when using the editable meshes, using the GetVertices() function attached to it, ONLY returns the vertices relative to the ORIGINAL mesh size AND Position, that means scaling up the actual mesh doesn’t change where the vertices are.
Then I realize that the Editable Meshes have a dedicated Scale and Offset properties, but upon using them to match the size of the newly scaled mesh part, it still does NOTHING.
It’s a little difficult for me to explain through just typing, but if you end up watching the video, you will understand.
I’m also seeing no effect from the Scale and Offset properties of an EditableMesh. These properties are inherited from DataModelMesh so possibly they are just unimplemented right now or otherwise EditableMesh inherits from DataModelMesh for other backend reasons and these properties will never have any effect on an EditableMesh.
I think you may have a slight misconception of what GetPosition() is returning. The Vector3 is in “the mesh’s local object space”, however this local object space is unaffected by the Size of the MeshPart. For example, if I added a vertex at Vector3.new(0.5,0.5,0.5), this point will always be at the Back, Top, Right corner of the MeshPart regardless of it’s Size. This makes it possible to “scale” the EditableMesh onto the bounding box of the MeshPart. If you want to get the world relative Vector3 of a vertex you could calculate it like this:
function vertexToWorldPosition(meshPart: MeshPart, editableMesh: EditableMesh, n: number): Vector3
local vertexPos: Vector3 = editableMesh:GetPosition(n)
local worldPos: Vector3 = meshPart.CFrame * (meshPart.Size * vertexPos)
return worldPos
end
My problem was just that the properties were not working. on line 3 of the function we shouldn’t have to be multiplying the “meshPart.Size” Times the “vertexPos”, I would imagine that the Scale property of the editable mesh would do that for us, no?
(But we don’t REALLY know since the properties aren’t working )
It’s probably unlikely that Scale or Offset would alter the Vector3 information returned from GetPosition. If Scale and Offset are implemented for EditableMesh these would likely only affect the rendering of the EditableMesh relative to its parent MeshPart. It would be more intuitive for all getter/setter methods to remain unaffected by Scale and Offset and instead it would be up to the developer to account for them in the use cases where it comes up.