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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
Add comment