Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug [IN-18082]Trigger Colliders no longer fire OnTrigger... events after upgrading from 21.3 to 22.2.0b8

Discussion in '2022.2 Beta' started by KjartanK, Sep 28, 2022.

  1. KjartanK

    KjartanK

    Joined:
    Apr 7, 2018
    Posts:
    10
    I've just upgraded our project from 21.3.3 to 22.2.0b8 and physics triggers have stopped firing the OnTriggerEnter and OnTriggerExit events.

    Here is the simple script that should be firing the events:
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3.     public class SpatialInteractable : InteractableBase
    4.     {
    5.         // TODO: Key here is that Exit+Input should be disabled
    6.         private enum SpatialActivationType
    7.         {
    8.             Enter,
    9.             Exit
    10.         };
    11.  
    12.         [SerializeField]
    13.         private SpatialActivationType spatialActivationType;
    14.  
    15.         private void OnTriggerEnter(Collider other)
    16.         {
    17.             Debug.Log($"{other.name} Entered");
    18.          
    19.          
    20.         }
    21.      
    22.         private void OnTriggerExit(Collider other)
    23.         {
    24.             Debug.Log($"{other.name} Exited");
    25.         }
    26.     }
    27.  
    Here is the inspector for the player object that is entering the trigger:
    upload_2022-9-28_11-59-6.png

    And here is the inspector for the trigger object itself:
    (I have seen people mention that the trigger object should have a RigidBody component as well. I didn't have one on this object pre-upgrade and it worked as expected, and I've tested adding one now with no success.)
    upload_2022-9-28_11-58-29.png


    I've reported a bug with case ID: IN-18082
    Once the bug report is uploaded I'll test moving back to 22.1.17f1 to see if everything works as expected there (and edit in my results).

    Update: moving back to 22.1.17f1 has fixed this, so it seems to be a regression in 22.2.
     
    Last edited: Sep 28, 2022