Unable to cast vector3 to float So annoying

i havent tried anything because i got literally no idea about that

this is where the applygkforce function gets called:

function reactRA(hit)
	if Kick == false then return end
	if hit.Name ~= "TPS" then return end
	Kick = false

	local u = math.sqrt(hit.Velocity.X^2 + hit.Velocity.Z^2)
	local HitDirection = (hit.Position - Player.Character["Right Arm"].Position).unit * Vector3.new(50, u * 0.75, 50)
	ToolManagement.ApplyGKForce(hit, HitDirection)
end


function reactLA(hit)
    if Kick == false then return end
    if hit.Name ~= "TPS" then return end
    Kick = false

    local u = (math.sqrt((math.abs(hit.Velocity.X) ^ 2) + (math.abs(hit.Velocity.Z) ^ 2)))
    local HitDirection = (hit.Position - Player.Character["Left Arm"].Position).unit * Vector3.new(50 , u * 0.75, 50)
    ToolManagement.ApplyGKForce(hit, HitDirection)
end

function reactRL(hit)
    if Kick == false then return end
    if hit.Name ~= "TPS" then return end
    Kick = false

    local u = (math.sqrt((math.abs(hit.Velocity.X) ^ 2) + (math.abs(hit.Velocity.Z) ^ 2)))
    local HitDirection = (hit.Position - Player.Character["Right Leg"].Position).unit * Vector3.new(50 , u * 0.75, 50)
    ToolManagement.ApplyGKForce(hit, HitDirection)
end

function reactLL(hit)
    if Kick == false then return end
    if hit.Name ~= "TPS" then return end
    Kick = false

    local u = (math.sqrt((math.abs(hit.Velocity.X) ^ 2) + (math.abs(hit.Velocity.Z) ^ 2)))
    local HitDirection = (hit.Position - Player.Character["Left Leg"].Position).unit * Vector3.new(50 , u * 0.75, 50)
    ToolManagement.ApplyGKForce(hit, HitDirection)
end

function reactH(hit)
    if Kick == false then return end
    if hit.Name ~= "TPS" then return end
    Kick = false
    
    local u = (math.sqrt((math.abs(hit.Velocity.X) ^ 2) + (math.abs(hit.Velocity.Z) ^ 2)))
    local HitDirection = (hit.Position - Player.Character["Head"].Position).unit * Vector3.new(50 , u * 0.75, 50)
    ToolManagement.ApplyGKForce(hit, HitDirection)
end

function reactT(hit)
    if Kick == false then return end
    if hit.Name ~= "TPS" then return end
    Kick = false

    local u = (math.sqrt((math.abs(hit.Velocity.X) ^ 2) + (math.abs(hit.Velocity.Z) ^ 2)))
    local HitDirection = (hit.Position - Player.Character["Torso"].Position).unit * Vector3.new(50 , u * 0.75, 50)
    ToolManagement.ApplyGKForce(hit, HitDirection)
end

applygkforce function

function ToolManagement.ApplyGKForce(hit, direction, limb)
	local localHitPos = hit.Position

	for i, v in pairs(hit:GetChildren()) do
		if v:IsA("BodyVelocity") then
			v:Remove()
		end
	end

	for i,v in ipairs(character.Torso:GetChildren()) do
		if v.Name == "BodyVelocity" then
			v:Destroy()
		end
	end

	local owner = false
	if hit.Owner.Value == player or hit.Owner.Value == nil then
		owner = true
	end

	hit.Catch:Play()

	local initialv = (math.abs(hit.Velocity.X) + math.abs(hit.Velocity.Z))

	initialv = 35 + initialv

	local initialy = math.abs(hit.Velocity.Y)


	local React = Instance.new("BodyVelocity")
	React.Velocity = ((player.Character["Torso"].CFrame * CFrame.fromEulerAnglesXYZ(0,direction,0)).lookVector * initialv) + (player.Character["Torso"].CFrame.upVector * initialy)
	React.MaxForce = Vector3.new(1e+005, 1e+005, 1e+005)
	React.Parent = hit
	game.Debris:AddItem(React, 0.3)

	game:GetService("ReplicatedStorage").Remotes.RemoteEvents.ChangeOwnerGK:FireServer(hit, localHitPos, direction, initialv, initialy, character[limb])
end```
error is at this line from the applygkforce function:

React.Velocity = ((player.Character["Torso"].CFrame * CFrame.fromEulerAnglesXYZ(0,direction,0)).lookVector * initialv) + (player.Character["Torso"].CFrame.upVector * initialy)
**Unable to cast vector3 to float**

Its quite a long line with a bunch of equations. Split it up into a variety of variables first to see which part specifically errors

just now i figured out that the Direction goes as nil