Search Issue Tracker
By Design
Votes
6
Found in
Issue ID
734257
Regression
No
Commands with duplicate names call wrong command.
when [Commands] are used that are non-unique (i.e. when there is several instances of the same NetworkBehavior script attached to a GameObject, or a parent class with multiple child classes attached to the same GameObject) then incorrectly calls the [Command] on the 1st instance in the hierarchy when called from the localClient regardless of which instance calls the [Command].
To replicate bug place 3 instances of this TestCommand script onto a player object. They will be given unique ID's of 1, 2, and 3. Pressing keys 1, 2, and 3 calls the [Command] on each respective instance. Results are as follows.
On the host
Pressing key #1 calls [Command] for instance #1
Pressing key #2 calls [Command] for instance #2
Pressing key #3 calls [Command] for instance #3
On the localClient
Pressing key #1 calls [Command] for instance #1
Pressing key #2 calls [Command] for instance #1 (bugged)
Pressing key #3 calls [Command] for instance #1 (bugged)
The debug output shows the bug where calling a command on index 3 calls the [Command] on index 1
OnClient: "Key pressed for uniqueID=3"
OnHost: "CmdTest called for uniqueID=1"
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- SystemInfo.get_graphicsDeviceName() is generating garbage GC Alloc when using Metal graphics API
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
Zullar
Oct 07, 2015 23:03
Code to replicate bug
http://forum.unity3d.com/threads/command-inheritance-heirarchy-index-mismatch-bug.359772/#post-2329645