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
- Transform fields are impossible to edit when Inspector window is resized
- Actions in UI Builder Preview mode are not fully reset after exiting the Preview mode
- Transform field values are no longer visible when Inspector window is resized
- [Android] "Adding null Transform to TransformAccessArray will result in degraded performance" warnings printed when loading and unloading scenes with 2D animated characters
- "Trying to draw gizmos while inside a renderpass" error message is thrown when Scene View Gizmos are enabled
Add comment