shootevent.OnServerEvent:Connect(function(plr,targetpos)
local character = plr.Character
local ball = character:FindFirstChild("Handle")
local hand = character:FindFirstChild("RightHand")
for _, c in pairs(hand:GetChildren()) do
if c:IsA("Motor6D") or c:IsA("Weld") or c:IsA("WeldConstraint") then
c:Destroy()
end
end
for _, f in pairs(ball:GetChildren()) do
if f:IsA("BodyMover") or f:IsA("AlignPosition") or f:IsA("AlignOrientation") then
f:Destroy()
end
end
local t = 0.5
local g = Vector3.new(0, -workspace.Gravity, 0)
local x0 = hand.Position + hand.CFrame.LookVector
local v0 = (targetpos - x0 - 0.5 * g * t * t) / t
ball.Anchored = false
ball.Velocity = Vector3.zero
ball.CanCollide = true
local bv = Instance.new("BodyVelocity")
bv.Velocity = v0
bv.MaxForce = Vector3.new(1e5, 1e5, 1e5)
bv.P = 1250
bv.Parent = ball
ball.Parent = workspace
game:GetService("Debris"):AddItem(bv, t + 0.5)
end)
Why is the shooting animation not working - DISCLAIMER as the video will show the problem isnt that tjhe function fires - it does the ball just does not go where I want it to.