#Basketball Shooting Animation

1 messages · Page 1 of 1 (latest)

wintry ginkgo
dusk bay
#

hmm you didn't use function which named ComputeProjectileVelocity :?

#

It should go in an arc towards the rim but instead it just shoots off into some random place
i guess .w.

wintry ginkgo
#

@dusk bay wait what

#

can you explaine

dusk bay
#

hmm
ComputeProjectileVelocity looks notthing wrong
maybe your startpos or targetpos wrong :?

wintry ginkgo
#

huh

#

@dusk bay wym

dusk bay
#
function ComputeProjectileVelocity(startPos, targetPos, maxHeight)
    local direction = targetPos - startPos
    local horizontal = Vector3.new(direction.X, 0, direction.Z)
    local distance = horizontal.Magnitude
 
    local gravity = math.abs(workspace.Gravity)
    local heightDifference = targetPos.Y - startPos.Y
    local peakHeight = math.max(heightDifference + 2, maxHeight) -- ensures arc clears target
 
    local timeUp = math.sqrt((2 * peakHeight) / gravity)
    local timeDown = math.sqrt((2 * (peakHeight - heightDifference)) / gravity)
    local totalTime = timeUp + timeDown
 
    local velocityY = math.sqrt(2 * gravity * peakHeight)
    local velocityXZ = horizontal.Unit * (distance / totalTime)
 
    return Vector3.new(velocityXZ.X, velocityY, velocityXZ.Z)
end```
your startPos and targetPos is true :?
lucid spear
#

basically i checked and i saw some problems..
The problem i think it was.. about shotclockbanner2 variable is redundant as it references the same object as shotclockbanner...

#

so i removed shotclockbanner2 and updated the code to use only the shotclockbanner.

#

@wintry ginkgo

wintry ginkgo
#

so a variable is what is causing my shooting animation to bug out @lucid spear

mighty spindle
#

show recording of this bug?

wintry ginkgo
primal lodgeBOT
#

studio** You are now Level 2! **studio

mighty spindle
#

that's not a recording

wintry ginkgo
#

did you click on it?

#

I don't have anything better.

mighty spindle
#

no one has access to the files on your local pc so no one can open it, except for you