I’m trying to do a footprint system, without using AnimationEvents, i’m trying to get the current player footstep, someone can help me with this?
My current code:
do -- Movement functions
function FootStep(leg)
local Params = RaycastParams.new()
Params.FilterDescendantsInstances = {Player.Local.Character}
local origin = leg.Position
local direction = Vector3.new(0, -1, 0)
local raycast = workspace:Raycast(origin, direction * 3, Params)
if raycast and raycast.Distance < 1 then
Network:Send('CreateStep', {Position = raycast.Position, Normal = raycast.Normal})
end
end
end
Run.RenderStepped:Connect(function()
if Player.Local.Character.Humanoid.MoveDirection ~= Vector3.new() then
FootStep(Player.Local.Character['Right Leg'])
FootStep(Player.Local.Character['Left Leg'])
end
end)