objects going through solids?

I don’t know if this is a bug or my coding is wrong, I have a dynamic ball and a static floor, I’m using physics (0,0) gravity and the accelerometer.

When I make the ball go down to the floor it slowly goes through it and disappears

*Moved from bugs to developer support by Peach [import]uid: 41389 topic_id: 19722 reply_id: 319722[/import]

Take a look at this post; http://blog.anscamobile.com/2011/08/solutions-to-common-physics-challenges/

Are you trying to make the ball bounce off the ground or simply not be able to go through it? If you don’t want it to go through you could code it so that the ball can’t go above y = 460, or the like.

Peach :slight_smile: [import]uid: 52491 topic_id: 19722 reply_id: 76332[/import]

Thanks Peach, that post helped a lot!

I’m creating a game based off your accelerometer tutorial and I was experimenting with a mountain like floor but before setting up the polygons I noticed the ball would just go right through if tilt far enough.

Im trying to make the ball simply not go through, I’ll play around with the code see if I can get it to work

Thanks again Peach [import]uid: 41389 topic_id: 19722 reply_id: 76340[/import]

Take a look and let me know - there may also be better ways to move the ball to avoid this, although I’m not certain on the exact code off hand without digging through my own tutes :wink:

Something applying impulse rather than adjusting gravity (as I think my example does?) may be best.

You could also look at the D pad tutorial to try and combine the two, that controls movement differently but would work with the accelerometer with a little tweaking.

Peach :slight_smile: [import]uid: 52491 topic_id: 19722 reply_id: 76371[/import]