So I have snow terrain in my game and I'm trying to make the snow have "footprints" also called deformation. I have a script and it has a couple of errors.
local Players = game:GetService("Players") local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") local humanoidRootPart = character:WaitForChild("HumanoidRootPart") local floorChangedSignal = humanoid:GetPropertyChangedSignal("FloorMaterial") floorChangedSignal:Connect(function() if humanoid.FloorMaterial == Enum.Material.Snow then local Ray = Ray.new(character.Head.CFrame.p, character.Head.CFrame.LookVector * Vector3.new(0,100,0)) local ignoreList = {humanoid.Parent} local hit, hitposition = workspace:FindPartOnRayWithIgnoreList(Ray, ignoreList) if hit and hit:IsA("Terrain") then workspace.Terrain:FillBall(hitposition, 2, Enum.Material.Air) end end end)