Search Issue Tracker
Won't Fix
Votes
0
Found in
4.6.9f1
Issue ID
758056
Regression
No
Different output with GameObject.SendMessage() when defined methods have different sequence in class
Having such method sequence in class as showed below, SendMessage() always calls the method with no parameter, no matter what parameter it sends:
//No parameter
public void Method(){}
// String paprameter.
public void Method(string str){}
If we switch method's places in script, SendMessage() works as expected, regarding parameter's variable.
Reproducible on 4.6 - 5.4 versions.
Repro steps:
1. open "SendMessageTest.zip".
2. open "Test1" scene and press play. Press keyboard buttons according to instructions. Observe that sending different parameters, always getting "No parameters" function message.
3. open "Test2" scene and press play. Press the same buttons and observe, that different parameters are recognized as expected.
The only difference is the methods sequence in scripts.
Expected result: should work despite the methods sequence.
---
Won't fix:
This issue will not be fixed, because SendMessage() does not try to handle method overloads, for performance reasons. We have updated documentation to reflect this.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on when D3D12RenderPass::SetupDeviceResources when opening FBX animation preview
- Serialization errors are thrown when "com.unity.render-pipelines.core" is added as a custom package and Graphics window is opened
- Character Joints unexpectedly rotate when a ragdoll is created using the Ragdoll Wizard
- Crash on GfxDeviceD3D11Base::DrawBuffersBatchMode when rendering the Scene view
- The shared EditorBuildSettings.asset file of symlinked projects is not updated when changing the order of the Scenes in Build Settings in one of the projects
Add comment