I made a system that uses MeshDeformation to deform a track when the wheels move. The issue I am having with it is that it doesn’t deform on the client.
What it looks like client side
What it should be looking like
Code:
local Wheels = script.Parent.Parent.Wheels.RightWheels
for i,v in pairs(script.Parent.TrackMesh:GetChildren()) do
if v:IsA("Bone") then
local OriginPos = Instance.new("Vector3Value")
OriginPos.Name = v.Name
OriginPos.Value = v.Position
OriginPos.Parent = script
end
end
game:GetService("RunService").Stepped:Connect(function()
for i,v in pairs(script.Parent.TrackMesh:GetChildren()) do
local SplitString = string.split(v.Name, " ")
if Wheels:FindFirstChild("Right"..SplitString[2]) then
v.WorldPosition = Wheels["Right"..SplitString[2]].WheelWeld.Position
local Offset = (v.Position - script[v.Name].Value)
v.Transform = CFrame.new(-Offset)
end
end
end)