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"
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Zullar
Oct 07, 2015 23:03
Code to replicate bug
http://forum.unity3d.com/threads/command-inheritance-heirarchy-index-mismatch-bug.359772/#post-2329645