Search Unity

Problem with Physic2D.IngoreLayerCollision

Discussion in 'Physics' started by lavz24, Nov 26, 2014.

  1. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    Hi,

    Im using Unity 4.3.3 ( I cant use 4.5+ because the paltform I use doesnt support yet).

    Im trying to do OneWayPaltform.

    I use a trigger to call Physic2D.IngoreLayerCollision to ignore platforms, but if I already colliding with one platforms Unity doesn't ignore that platform in specific even though the matrix collider show the ignore layers set correctly.

    Why this happens??
     
  2. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    Seems like you already triggerd on collision enter event
     
  3. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    I have two colliders. One is a trigger and it's on a different layer from the one I'm ignoring. The other one is the one I'm using as the one way platform, and it's on the OneWayLayer.

    So the thing is that the system works if I'm not already colliding with the collider in the OneWayLayer: if I'm touching it, the collision will remain until I stop touching it. After that everything will work normally.
     
  4. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    So you're jumping up and through a platform and trying to land on top of it, is that correct?

    Try to break this down into manageable steps