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
- Missing Render Feature "Full Screen Pass Render Feature" in any “Universal Renderer Data” asset when upgrading from 2022.3
- Inconsistent ParticleSystemVertexStream.PercentageAlongTrail data range in Trail Texture Modes except "Stretch"
- The Graph Debug Window can be right clicked through and the Node Workspace is manipulated instead
- [Linux] Top left corner of the screen is unresponsive when the Editor recompiles
- [Android] [Vulkan] Cubes stuck on the first few frames of rotation and application flickering when an Overlay Camera is added to the Camera Stack with MSAA enabled
Add comment