Search Unity

OnTriggerEnter undocumented breaking change?

Discussion in 'Physics' started by AndersMalmgren, Oct 14, 2017.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    We are moving from 5.5.4 to 2017.2. Our game broke when it comes to our inventory system (VR Game). You can grab a item from a inventory on your chest and then store it again when you hover over it and let go of the item.

    This worked in 5.5.4, the frame the item is grabbed it also goes live and the OnTriggerEnter event triggered and the item was registered as hovering, if the user let go the item would be stored again. In 2017.2 the OnTriggerEnter does not trigger when the item goes live. Meaning if you do not leave the inveotory area and return the OnTriggerEnter will never trigger and the item will not be considered as hovering over the area.

    So since this worked in 5.5.4 and not in 2017.2 something has changed in how OnTriggerEnter works.

    What we do when a item is stored is that we set its colliders to istrigger so it can not effect items in the world, but you can still pick the item up.

    So please any light on why OnTriggerEnter behaves differently in 2017 would be nice. Thansk
     
    Last edited: Oct 14, 2017
  2. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Has Unity done an unintentional change to the way OnTriggerEnter behave? What we do it change a items colliders from isTrigger = true to false, with Unity 5.5.4 this retriggered the OnTriggerEnter event. But not n 2017.2f3
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Anyone from Unity that can shed light? We really want to upgrade since we are on 5.5.4
     
  4. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    There are no changes. Sounds like you need to check what changes to PhysX have happened on Nvidia side. And make sure your project settings are unchanged.

    Also much of the API has changed so make sure your functions are calling the correct (i.e. non obselete or deprecated methods).
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Nothing has changed on our end suddenly OnTriggerEnter does not trigger anymore. One can think trigger OnTriggerEnter when a collider goes from isTrigger true to false can seem strange, but thats how it worked in 5.5. Seem not to in 2017.2

    Collider.isTrigger and MonoBehaviour.OnTriggerEnter are not marked as obsolete in docs