Hi, I was making this module to make the Ball when it’s kicked fly away with velocity with the desired orientation like if the orientaition is high then the ball launches higher orientation. What I couldnot was able to achieve was the Throwing motion of the ball. heres a module i made for it. Can someone please help me with it.
local module = {}
function module.ThrowBall(player,Ball,V) -- player is the players humanoid root part lookvector and V is the orientation where the ball needs to go
local antiGravity = Instance.new("BodyForce")
local antiGravityFactor = 0.9--1 = gravity force counteracted, 0 = no force lol
antiGravity.Force = workspace.Gravity*antiGravityFactor *Vector3.new(0,1,0)
antiGravity.Parent = Ball
local appliedVelocity = (CFrame.new(player,V).LookVector * 600)
Ball:ApplyImpulse(appliedVelocity)
end
return module