Search Unity

Rigidbody AND Collider Colliding?

Discussion in 'Editor & General Support' started by mwillson, Apr 6, 2018.

  1. mwillson

    mwillson

    Joined:
    Jul 1, 2015
    Posts:
    5
    Hi,

    I have a dynamic rigidbody2d attached to an object which also has a collider2d. Under the 'info' section of the collider2d component, all the info about the attached rigidbody is there, as expected.

    The problem is that the collider is offset from the rigidbody/gameobject transform center, and I want ONLY the bounds of the collider to define collisions; however, it seems the rigidbody itself ALSO registers collisions, thus creating behavior counter to what is intended, restricting movement in ways I do not want. Is this the way it is supposed to work or am I a weird edge case (i.e. the devs didn't intend the physics system to be used this way)?

    The only workaround I've found for this so far is to create a child gameobject with the sprite renderer and animator, which has its transform offset from the main object with the rigidbody, thus eliminating the need to offset the collider.

    Is there a more elegant way to deal with this, NOT involving child gameobjects?