EditableMesh should not be stored in replicated locations on the server

Hey guys im currently watching this tutorial:

in the tutorial I wrote this code:

local AssetService = game:GetService("AssetService")

local Object = script.Parent
local EditableMesh = AssetService:CreateEditableMeshFromPartAsync(Object)
EditableMesh.Parent = Object

local Vertices = EditableMesh:GetVertices()
local VerticesPositions = {}

for _, vertex_id in Vertices do
	local position = EditableMesh:GetPosition(vertex_id)
	VerticesPositions[vertex_id] = position
end

while true do
	task.wait()
	for vertex_id, position in VerticesPositions do
		local new_position = position + position.Unit * math.noise(
			position.X / 10, 
			position.Y / 10, 
			position.Z / 10
		)
		EditableMesh:SetPosition(vertex_id, new_position)
	end
end

However I am getting this error:

  22:45:04.889  EditableMesh should not be stored in replicated locations on the server. The EditableMesh Workspace.SphereII.EditableMesh will not be usable on the client. Please use locally created EditableMeshes instead.  -  Studio

It doesnt make sense though because im following exactly like the tutorial and it doesnt work.

1 Like

Nevermidn guys the solution is to make the script runcontext to be server instead of legacy in its properties

If anyone has the same issue but the solution doesnt work, change the runcontext to client instead of legacy/server, that worked for me

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.