Search Issue Tracker
By Design
Votes
1
Found in
2017.1.0p4
Issue ID
956455
Regression
No
OnTriggerStay not called when Script is added during Runtime on Collision to a Collider game object that is a child Of RigidBody
Steps to reproduce:
1.Open attached “RuntimeAddScriptTrigger.zip” Unity project
2.Open scene “Test"
3.Enter Play mode
4.Expand “Parent” object in the Hierarchy to see its child objects
5.Attach the “Triggers.cs” script to “TriggerObject”
Expected results:
OnTriggerStay is called and debug message “Stay triggered by BoxCollider" is shown
Actual results:
OnTriggerStay is not called
Reproduced in: 2017.3.0b3, 2017.2.0f3, 2017.1.2f1, 5.6.4f1, 5.5.5f1, 5.5.0f1
Note: Works as expected if the script is attached while not in runtime or parent object does not have a Rigidbody component.
_____________
By design:
OnTriggerStay depends on having processed OnTriggerEnter first internally, which is not done if there were no scripts interested in that event at the time the overlap was detected first (for performance reasons)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [VFX] Custom HLSL with 'int' parameter, without the 'in/out/inout' access modifier is not supported
- [Windows] Lens Flare doesn't work in the Lens Flare Showroom URP Sample Scene
- Crash on ujob_execute_job while using OverlapBoxCommand when collisions are more than maxHits
- The validity of the multiple handles can behave differently based on the load/release operations order, when multiple Addressables.LoadAssetAsync and Addressables.Release are used to load and release the same Addressable Asset
- Dynamic text is rendered in the background when it is inside the <font> tag
Add comment