I'm making a game that requires the player (a bird character) to be able to push boxes around and pick up the boxes and fly around with them.
I've created what i need using a combination of physics and pinning. The physics make it a breeze to allow the the player to push boxes around. To fly with a box the player lands on the box then immediately jumps to pin the box to them. If they press left or right whilst still on the ground the box will immediately unpin. This allows the player to walk along the top of boxes without moving them. If you continuously press jump along with the left and right arrows you can fly around with the box.
However, if you look at my example capx file you'll see that it's possible to jump onto a box, and, as you land, pushing the left or right arrow you can still become pinned to the box. Worse still the box and the player will start moving along the ground and keep moving, even if you don't press any player controls.
I've tried numerous different methods to get my player control system to work but they all fall apart because of this odd behavior where landing on another movable object will cause both the player and the object to move off in a direction randomly, sometimes even rendering the game controls disabled.
Am I missing some setting somewhere or is my code not quite right? I'd really appreciate some help. I've spent weeks on this and just can't seem to crack the problem.
Link to my capx file
drive.google.com/file/d/0B-jb1QwWydW_b3lqVmx6R1NBV28/view