[physics engine] Bodies intersecting / "falling through" other objects

Hi all,

Hope somebody can shine some light on what I’m doing wrong here, since I’m totally in the dark about it. (how’s that for idioms!)

Simply put, I have the following setup

O ------
When the ball is resting on the floor, I move the floor upwards, this causes the ball to slowly work its way through and causes erratic behavior.

I tried using the below both at the same time and separately, but to no avail:

physics.setPositionIterations( 32 )  
physics.setVelocityIterations( 16 )  

I can’t imagine this being something impossible but doing it is, so far :slight_smile:

Thanks in advance for any help!

  • Reinier [import]uid: 53290 topic_id: 9398 reply_id: 309398[/import]

I am also having the same issue. Has anyone solved this ?
Thanks,
JM [import]uid: 39088 topic_id: 9398 reply_id: 42339[/import]

I’ve had this issue myself; some people have suggested setting isBullet - although I tend to use a workaround when able.

Would adding a Runtime listener to keep the ball from moving through the floor be a possible solution for the time being?

Peach [import]uid: 52491 topic_id: 9398 reply_id: 42394[/import]

Thanks for taking the time to reply Peach. Ya a Runtime would definately work. I tried setting object.isBullet = true, that had no effect. But setting up a Runtime to not let my character pass the current platforms y position sounds like it would work well. I will definately give it a shot.
Thanks,

JM [import]uid: 39088 topic_id: 9398 reply_id: 42409[/import]

I had the same issue - actually I tried moving the floor upwards while it was colliding with the ball, but changing the position of an object that was colliding wasn’t possible and Corona gave me an Error which I couldn’t find an answer for :confused: [import]uid: 13097 topic_id: 9398 reply_id: 42526[/import]

Were you trying to change the position on collision? If so, yes, that often throws up errors as the collision isn’t “resolved”.

When I moved it manually I didn’t have a collision listener in place, if that helps.

Peach :slight_smile: [import]uid: 52491 topic_id: 9398 reply_id: 42654[/import]

Hm I was trying many things to make it work. Transitions seem to work while there’s a collision event, but changing the position otherwise doesn’t :confused: Seems kinda odd to me :wink:

I might try to remove the collision event and fire up my moveFloor function which will also turn on the collision event. Maybe that would work (even though it looks kinda ugly to me ^^)

Chris [import]uid: 13097 topic_id: 9398 reply_id: 42696[/import]

I’ve had the same problem. I have a slingshot. When pulled back into a V shape the sides would sometimes squeeze the “ball” to the point it falls through the slingshot rubber-band.
I put a patch in that would detect such occurences and move the ball back to the correct side of the rubber-band. Not a nice fix but working for now. I also tried adjusting the iterations and setting ‘isbullet’… but nothing worked.
Hopefully this can be fixed in the physics engine. [import]uid: 16901 topic_id: 9398 reply_id: 42708[/import]

Have you tried setting body.isSleepingAllowed to false? I had an issue with a physics object (a ball) either passing through other objects or not responding (sleeping) after a certain period of time. Setting body.isSleepingAllowed = false fixed my problem but I don’t know if it will work for your situation. It’s not really a good idea to not allow a physics object to sleep as it will continously consume CPU processing power but if you only do it to one or two objects it should be okay. [import]uid: 27965 topic_id: 9398 reply_id: 42720[/import]

I did try “no sleeping” but that didn’t work either. I spent quite a bit of time trying to fix it without any luck. I really think it is an issue with the physics engine but, then again, maybe its just me. [import]uid: 16901 topic_id: 9398 reply_id: 42733[/import]

Same here. [import]uid: 40033 topic_id: 9398 reply_id: 50549[/import]

Jon Beebe recently wrote this and it is well worth a look;

http://blog.anscamobile.com/2011/08/solutions-to-common-physics-challenges/ [import]uid: 52491 topic_id: 9398 reply_id: 50560[/import]