PROBLEM
I did this exact topic and hour ago and thought i found the solution. I didnt.
Sorry devs for the flag (Old topic - deleted).
I’m trying to make a render on a Mesh, using EditableMesh.
As you know, you are given an OPT “doublesided” button. When false/off the Normal ID inside the mesh is TRANSPARENT.
I want to make every front face to flip (normal) to the inside (TRANSPARENT) face, when not in range of Mesh.
When the “HumanoidRootPart.Position” and “Mesh.Position” are in range together (16 STUDS) the back (which is coming in range [TRANSPARENT]) will flip to the front to make that face visible.
Making a seamless transition of each face rendering.
SOLUTION
I’ve found out that this does in fact improve performance as crazy as it sounds although i haven’t got to it.
As well it fits towards my game.
CODE
--Services
local AssetService = game:GetService("AssetService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
--Players
local player = game:GetService("Players").LocalPlayer
--Character
local character = player.Character or player.CharacterAdded:Wait()
--Folders
local Meshes = workspace:WaitForChild("Meshes")
--Tables
local Table = {}
local MeshTable = {}
--Character BaseParts
local HumanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local function onRenderStepped()
--for loop Mesh
for _, Mesh in ipairs(Meshes:GetDescendants()) do
if Mesh:IsA("MeshPart") then
--EditableMesh
if not MeshTable[EditableMesh] then
MeshTable[Mesh] = AssetService:CreateEditableMeshFromPartAsync(Mesh)
end
local EditableMesh = MeshTable[Mesh]
local GetFaces = EditableMesh:GetFaces()
local GetVertices = EditableMesh:GetVertices()
--for loop GetFaces
for _, Face in GetFaces do
local GetFaceVertices = EditableMesh:GetFaceVertices(Face)
--for loop each Vertex for each face
for _, Vertex in GetVertices do
if (HumanoidRootPart.Position - Mesh.Position).Magnitude < 16 then
EditableMesh:SetFaceNormals(Face, {Enum.NormalId.Front})
else
EditableMesh:SetFaceNormals(Face, {Enum.NormalId.Bottom})
end--end if statement
end--end for loop each Vertex
end--end for loop GetFaces
------
end
end--end for loop Mesh
end--end function onRenderStepped
RunService.RenderStepped:Connect(onRenderStepped)
ERROR
“Number of attributes provided does not match face - Client - EditableMesh:57”
OR
“Invalid faceId - Client - EditableMesh:57” – if you change Face variable to Vertex
– this is due to it irritating through every face. idk how to stop it PLSS HELP :((