Search Unity

Rigidbody2D bug or am I doing something wrong?

Discussion in '2D' started by dookie-boy, Nov 14, 2013.

  1. dookie-boy

    dookie-boy

    Joined:
    Nov 29, 2012
    Posts:
    7
    This is my problem:

    So far I used normal Rigidbodies in my 2D platformer, and they worked as expected.
    There's a box (with Rigidbody) that the player can pick up and carry around. When the box is being carried, his Rigidbody becomes kinematic, and is parented to the player. This way, the box moves with the player as he walks.

    However, today I started to change all Rigidbodies to Rigibody2D, and this is what happens with the box:

    $rbody_bug.png

    - The box doesn't immediately "follow" the player. This causes the box to be left behind.
    - The BoxCollider2D of the box gets messed up. When the player turns, it fixes itself, but as soon as the player moves, it offsets again.

    So, I know that using the hierarchy is not best way to deal with Rigidbodies, but this seemed to work so fine with the old ones, I just don't get what's going on.
     
  2. Keshav

    Keshav

    Joined:
    Jan 17, 2013
    Posts:
    11