Sticky Objects using Physics?

I’m working on a game wherein ObjectA collides with ObjectB.
ObjectA then becomes stuck to ObjectB and travels with ObjectB (back and forth) until the player presses a button.
When the player presses the button then ObjectA is launched away from Object B.

Just wondering of there is a way to set the physics properties so that the objects are “sticky.”

Right now I’m not really sure that I should be using physics for this type of game play… but I certainly like the built in collision detection and gravity for falling objects that physics provides.

Any insight would be greatly appreciated. Thanks!
Tim [import]uid: 16901 topic_id: 19591 reply_id: 319591[/import]

Maybe attach a joint? and break it when required? [import]uid: 84637 topic_id: 19591 reply_id: 75667[/import]

The joint was a good idea… but I tried all sorts of joints with all sorts of connecting points and nothing worked well. I guess I should just come out and say that I’m trying to make a player able to jump from vine to vine… like the old school jungle hunt game. If they could do it in 1980 I’m sure we can do it with Corona. Of course, they didn’t have a physics engine so maybe physics is not the way to go. Any other ideas? Thanks! [import]uid: 16901 topic_id: 19591 reply_id: 75700[/import]

Have you tried pivot, it should do the job.

 myJoint = physics.newJoint( "pivot", ObjectA, ObjectB, ObjectA.x,ObjectA.y )  

Joakim [import]uid: 81188 topic_id: 19591 reply_id: 75707[/import]

Create the join outside the collision handler in a separate function. I did this today and it works 100%.

Joakim

[import]uid: 81188 topic_id: 19591 reply_id: 75708[/import]