Search the Community
Showing results for tags 'floor'.
Found 2 results
I have a bouncing ball and I want to detect that the ball has "hit the floor" in my game. Is there any predefined method for detecting this?
I'm not sure if it's exactly Babylon.js question, but here's the situation I can't deal with for a while now... I have a box (player), that has velocity and etc. things, right? While the box doesn't touch (intersects) anything it's — player.velocityY -= worldGravity, when it touches something — player.velocityY = 0 and no worldGravity applies anymore, right? Things work as they should. The problem is that -velocityY is so high that player gets inside of the floor and only then stops. I tried everything I could: intersects for meshes, for bounding boxes, points, even rays infos (distance and etc.); but nothing helps because -velocityY is higher than collision code runs (I'm not sure but that's my only though, since less velocity works just fine). Player's velocity by Y gets between -8 and 0, while gravity is 0.25. Any thoughts? player.y++ while intersects isn't an option, of course.