Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

OnTriggerEnter and ExecuteInEditMode

Discussion in 'Editor & General Support' started by bsanterre, Mar 30, 2015.

  1. bsanterre

    bsanterre

    Joined:
    Oct 8, 2014
    Posts:
    21
    Hi,

    I have a scene created in Unity 4 that does some overlap detecting in edit mode. To do that, I use OnTriggerEnter, OnTriggerExit, and OnTriggerStay in a component that has [ExecuteInEditMode]. In Unity 4, everything works great. When I move a GameObject that has my component, things get done.

    However, importing this scene in Unity 5 completely breaks everything. When I move my GameObject, I no longer enter my various trigger functions. However, Update() gets called, so ExecuteInEditMode does work.

    Is this intentional? Is there another way, in edit mode, to detect what is overlapping my GameObject?

    Thanks!
     
    Haape likes this.
  2. Haape

    Haape

    Joined:
    Sep 12, 2015
    Posts:
    1
    I have the same problem .. had you find something since ?
     
  3. LTK

    LTK

    Joined:
    Jul 16, 2015
    Posts:
    22
    I have the same problem :(
     
  4. N-i-x

    N-i-x

    Joined:
    Jan 27, 2014
    Posts:
    5
    Hi,

    I have the same issue, did you find a way to make it works ?
    I used the bounds in the Update to detect manually the collision, but it does not work well for 3D triangles (empty space in the bounds)

    Do you know how I could activate Trigger and Collision detection in the Editor with Unity 5 ?
     
  5. Nicola-Patti

    Nicola-Patti

    Joined:
    Apr 8, 2016
    Posts:
    2
    Same problem with Unity 5.5.0f3 The Events OnTriggerEnter2D, OntriggerStay2D and OntriggerExit2D work perfect in Play mode, if I use [ExecuteInEditMode] they still work in Play mode, but they DO NOT work in EditMode.
     
  6. SilverHuber

    SilverHuber

    Joined:
    Mar 24, 2015
    Posts:
    4
    Anyone already found a solution for this?
     
  7. ga5p0d3

    ga5p0d3

    Joined:
    Sep 27, 2017
    Posts:
    1
    I think I just hit this too in Unity 2017.1 (first time I've used Unity). Bad news for my interactive editing tools, can't find a solution or helpful reference to the problem anywhere. :(
     
  8. DragorKG

    DragorKG

    Joined:
    May 5, 2017
    Posts:
    1
    Hi,
    Same problem in Unity 2018.1! :( Had you find something? I am making interactive editing tool, too.
     
  9. darkgaze

    darkgaze

    Joined:
    Apr 3, 2017
    Posts:
    20