I want to be able to scroll the UV’s so i can get a moving Texture but the issue i’m running into is that the UV’s are noisy when moving them unless its super slow. This doesnt seem to be an issue with the Trigs because I’ve tried with a cube and gotten the same result. If I used deltaTime the uvs wouldn’t move either.
–What I want to achieve is this smooth uv movement.
–Current Issues and Iterations
local EditableMesh = AssetService:CreateEditableMeshFromPartAsync(object)
EditableMesh.Parent = object
-- Get vertices and UVs
local Vertices = EditableMesh:GetVertices()
local UVs = {}
for _, vertex_id in ipairs(Vertices) do
local uv = EditableMesh:GetUV(vertex_id)
UVs[vertex_id] = uv
end
local speed = 0
RunService.RenderStepped:Connect(function(deltaTime)
speed = script:GetAttribute("speed")
-- Iterate over vertices and update UVs
for _, vertex_id in ipairs(Vertices) do
local uvPos = UVs[vertex_id]
-- Modify UV position (example: adding time to X component)
local newVector = uvPos + Vector2.new(speed * (uvPos.X + os.clock()), 0)
-- Apply the new UV to the vertex
EditableMesh:SetUV(vertex_id, newVector)
end
end)