I currently have a ball and a jump button, and I have made it so that if you hold down the jump button, the ball bounces. However, the ball bounces perfectly when it first hits the ground, but after that it takes about a second for the ball to bounce again. Any suggestions as to why this is happening and how to fix it? Here is the code:
local function on\_hit (event)
if event.phase == "began" and hold == false then
ballIsGrounded = true
ball.angularDamping = 0
elseif event.phase == "began" and hold == true then
ballIsGrounded = false
ball:applyForce (0, 2000, ball.x, ball.y)
end
end
ball:addEventListener("collision", on\_hit)
[import]uid: 116264 topic_id: 20878 reply_id: 320878[/import]
) [import]uid: 84637 topic_id: 20878 reply_id: 82504[/import]