So, im making a football / soccer game and now im in shooting system, and i was gonna use BodyVelocity, but i knew it was depecreted, so im gonna use LinearVelocity which is similar in everything except the MaxForce, now my problem is when a player touches the ball while shooting the ball shoots to front-right direction of the player without curving and goes forever in that direction so im trying to get some help, and because im bad in physics, here is my script:
if shooting then
local LV = Instance.new("LinearVelocity")
LV.Parent = hit
LV.MaxForce = math.huge
LV.VectorVelocity = player.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * power
wait(1)
delay(1, function()
for i = 0, 1, 0.02 do
LV.VectorVelocity = LV.VectorVelocity + player.Character:WaitForChild("HumanoidRootPart").CFrame.RightVector * i
task.wait()
end
end)
task.spawn(function()
wait(0.1)
debounce = false
LV:Destroy()
end)
elseif tackling then
local LV = BallModule:ShootBall(player.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector, 50)
task.spawn(function()
wait(0.1)
debounce = false
LV:Destroy()
end)
end