What vector can I use so a ball that touches the player goes front of the player

Im scripting a reaction system for a football game, a reaction system is like the touch system so you can apply ball velocity and stuff.

    local u = (math.sqrt((math.abs(hit.Velocity.X) ^ 2) + (math.abs(hit.Velocity.Z) ^ 2)))
    if u < 30 then u = 30 end
    local F = Instance.new("BodyVelocity")               --this part
    F.Velocity = Player.Character.HumanoidRootPart.CFrame.rightVector * (u * 0.4) * Vector3.new(1, 0, 1)
    F.Velocity = F.Velocity + Vector3.new(0, math.abs(hit.Velocity.Y) * 2, 0)
    F.MaxForce = Vector3.new(1e+005, 1e+005, 1e+005)

I was using the rightVector for the cframe to apply velocity based react, velocity based react is when the ball is deflected with bodyvelocity based on the balls velocity.

I used rightvector which worked well but i wanna know what I can do to make the ball go straight instead of right

1 Like

Have you tried to use the LookVector? That goes forward in the positive and behind in the negative.

The ball rather then doing that, just goes up

perhaps try the RightVector or its negative?