I am trying to make a basketball shooting system, and I am having an issue where from a far distance, it is missing. This does make sense though as the arc height is not increasing. This leads me to my question: How can I control arc height given distance? With what I have now, increasing the time will increase arc height, but I want it to only influence the speed of the ball in the air.
local t = 0.75;
local hrp = character:WaitForChild("HumanoidRootPart")
local bball = character:FindFirstChild("Basketball"):FindFirstChild("Handle")
local g = Vector3.new(0, -game.Workspace.Gravity, 0);
local x0 = hrp.CFrame * Vector3.new(0, 2, -2)
-- calculate the v0 needed to reach mouse.Hit.p
local v0 = (rim.Position - x0 - 0.5*g*t*t)/t;
local c = bball:Clone();
bball.Transparency = 1
c.CanCollide = true;
c.Anchored = false;
c.Parent = game.Workspace;
c.CFrame = CFrame.new(x0)
c.Velocity = v0
wait(t * 2)
c:Destroy()