Sep 27, 2010 at 12:39 PM
Edited Sep 27, 2010 at 12:44 PM
I've got a wheel-and-torso player character, and a box. Both with sensible frictions and torque moving the wheel.
What I'm after is a situation where the box won't move if the player runs into it, but if the player moves up to it and actively pushes/ pulls it, it glides along the floor.
I've got it set up so my player class has a DistanceJoint 'grabJoint' set at the centre of the torso, which defines its BodyB as the centre of any body if you're standing close enough and press Ctrl.
Problem is, I can't move the box.
Strikes me there's a few ways to handle this from here, notably:
- Setting the friction to something low works well, but if there's a box on top of it, it'll slide out from under rather than taking both boxes.
- Decreasing the mass of the box temporarily. Again, works, but isn't ideal for when it's dropped.
- Increase torque on the wheel. This makes it juddery and unpredictable. Doesn't
really move the box very much.
Is there a better setup for dragging objects that I'm not seeing?