Wanting to know if there’s any tricks to bypass the 8 EditableMesh limit on client? I want to be able to create hundreds on a whim from the client. They’d be very identical (a rectangle, 6 faces) and I’d wanna just duplicate that rectangle segment and apply changes to it (size/position/faces) but atm I have to create a new editable mesh each iteration
local mesh = AssetService:CreateEditableMesh()
-- add all the faces
local meshPart = AssetService:CreateMeshPartAsync(Content.fromObject(mesh),{ CollisionFidelity=Enum.CollisionFidelity.Box })
This reaches limits way too quickly on client tho. And since server/client replication doesn’t work yet, that’s not viable.
Or am I best to wait for server/client replication to be supported? Cause ideally that’s what I want (client draws a mesh, goes to server, server generates) this way replication is super simple (vs having to client > server > all clients)
for i = 1, 100 do
local meshPart = AssetService:CreateMeshPartAsync(
Content.fromObject(mesh),
{ CollisionFidelity = Enum.CollisionFidelity.Box }
)
meshPart.CFrame += Vector3.new(i * 5, 7, 0)
meshPart.Anchored = true
meshPart.Parent = workspace
end
but to my knowledge there’s no way to edit each individual mesh parts faces?
EDIT
Managed to find way to “create” an EditableMesh 100+ times, but I can’t do anything to it?
local NewEditableMesh = AssetService:CreateEditableMeshAsync(Content.fromObject(OriginalEditableMesh))
-- Choose a random face to remove
local FaceToRemove = FacesToRemove[math.random(1, #FacesToRemove)]
NewEditableMesh:RemoveFace(FaceToRemove )
EditableMesh is fixed-size, adding or removing elements is not allowed in-experience
Idk if this a limitation in studio
Where are you getting the information about a limit of 8 EditableMesh per client? Afaik there isn’t a hard limit but instead any call to create an EditableMesh or EditableImage could return nil depending on if the available editable memory budget of the device is exhausted.
What’s your use case for creating “hundreds” of simple EditableMesh anyways? There may be another approach that doesn’t require memory-expensive EditableMesh allocation while achieving the same effect.
8 because thats as many as the memory will allow. If I create a 9th one it stops. Even if I wait a minute and try making a 9th one, it wont work.
Reason for this is allowing player customisation. I want players to be able to build using these, and they need to edit and change in an instant, and to allow them to create more than 8 in a single session
What exactly are the players building using these EditableMesh? What are they able to modify? What’s stopping you from using a single EditableMesh? You said they’d likely only have 6 faces (assuming 12 tris) - A single EditableMesh can support 60,000 vertices and 20,000 tris.
Walls. Each wall segment needs to be an individual mesh to support individual textures on each wall segment. These segments needs to adjust as walls around get added/removed. Like remove end faces if interesecting a wall, extend/trim faces to so they connect to other segments/etc.
You can’t do differing textures on faces. And I can’t do 1 single mesh, because each mesh part needs not only their size changed, but also their faces lengths changed too. It’s not a static mesh. If that was the case I’d just use parts. But Im using Meshes because I need to be editing mesh faces on each individual mesh
I’m not saying you can create more than 8 meshes - this is the bottleneck I’m attempting to help you get around. Documentation for EditableMesh clearly states:
Editable assets are currently expensive for memory usage. To minimize its impact on client performance, EditableMesh has strict client-side memory budgets
While it’s true that you can have only 1 texture applied to an EditableMesh (via the TextureContent property), efficiently creating an image asset which contains the texture data for multiple “textures” is possible - you may even consider using an EditableImage as the texture, allowing for runtime modification. Using either method and by modifying UV coords of faces on an EditableMesh, you can create the appearance of multiple textures on a single mesh.