Hi all,
I have created a ball that when it hits ground it will bounce. This ground is moving and it is also has complex collision so that there are down hills and uphills. I don’t actually want the ball to be affected by uphill or downhill but I have it in there to look nice. However when the ball bounces on a uphill slope of collsion data rather then applying the linear velocity it rolls up the hill until it reaches a flat or downward slop and then continues to bounce.
here is the code for my balls bounce I tried changing the phase to ended but that was not the problem. Any help would be great. Thank you.
[lua]circle:addEventListener(“collision”, circle)
function circle:collision (event)
–the ground1 2 & 3 below are my ground objects
if event.other == ground1 or event.other == ground2 or event.other == ground3 then
if event.phase == “began” then
circle:setLinearVelocity(0, bounceFactor) – bounce factor is set to -200
end
end
end [import]uid: 126017 topic_id: 23768 reply_id: 323768[/import]