Sorry i forgot to paste the code in really sorry
heres the main part thats not working
hum.Running:Connect(function()
ProceduralModule:IkLegStep(left_IkTarget, left_RaycastPart, passenger.PrimaryPart, 0.5, 2, 1, 0.05, rayCastParams)
left_IkTarget.Orientation = left_IkTarget.Orientation + Vector3.new(0, root.Parent.Torso.Orientation.Y, 0)
task.wait(0.1)
ProceduralModule:IkLegStep(right_IkTarget, Right_RaycastPart, passenger.PrimaryPart, 0.5, 2, 1, 0.05, rayCastParams)
task.wait(0.1)
end)
heres the entire script:
local ProceduralModule = require(game:GetService("ReplicatedStorage").ProceduralModule2)
local runService = game:GetService("RunService")
local passenger = script.Parent
local root = passenger:FindFirstChild("HumanoidRootPart")
local hum = passenger:FindFirstChild("Humanoid")
local alignOrientation = root:FindFirstChild("AlignOrientation")
local target = workspace:FindFirstChild("Target")
--// IkTargets
local ikTargets = passenger:FindFirstChild("IkTargets")
local left_IkTarget = ikTargets:FindFirstChild("LeftTarget")
local right_IkTarget = ikTargets:FindFirstChild("RightTarget")
--// Raycast parts
local raycastParts = passenger:FindFirstChild("RaycastParts")
local left_RaycastPart = raycastParts:FindFirstChild("LeftRaycast")
local Right_RaycastPart = raycastParts:FindFirstChild("RightRaycast")
--// IKControls
local left_IKControl = hum:FindFirstChild("LeftLegIK")
local right_IKControl = hum:FindFirstChild("RightLegIK")
left_IKControl.Pole = root.LeftAtt
right_IKControl.Pole = root.RightAtt
--// RaycastParams
local rayCastParams = RaycastParams.new()
rayCastParams.FilterDescendantsInstances = {passenger}
rayCastParams.FilterType = Enum.RaycastFilterType.Exclude
runService.Heartbeat:Connect(function()
local rayCast = workspace:Raycast(root.Position, -1000 * root.CFrame.UpVector, rayCastParams)
if rayCast then
local rotateToFloorCFrame = ProceduralModule:getRotationBetween(root.CFrame.UpVector, rayCast.Normal)
local floorOrientedCFrame = rotateToFloorCFrame * CFrame.new(root.Position)
local dz = (root.Position.Z - target.Position.Z)
local dx = (root.Position.X - target.Position.X)
local horizontalAngle = math.atan2(dx, dz)
alignOrientation.CFrame = floorOrientedCFrame.Rotation * CFrame.fromOrientation(0, horizontalAngle, 0)
end
end)
hum.Running:Connect(function()
ProceduralModule:IkLegStep(left_IkTarget, left_RaycastPart, passenger.PrimaryPart, 0.5, 2, 1, 0.05, rayCastParams)
left_IkTarget.Orientation = left_IkTarget.Orientation + Vector3.new(0, root.Parent.Torso.Orientation.Y, 0)
task.wait(0.1)
ProceduralModule:IkLegStep(right_IkTarget, Right_RaycastPart, passenger.PrimaryPart, 0.5, 2, 1, 0.05, rayCastParams)
task.wait(0.1)
end)