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
- Typos in High Definition 3D sample tutorials
- “Handles.Repaint called outside an editor OnGUI" error is thrown in the Console when creating a new Tile Palette from the Tile Palette Overlay in Scene view
- Shader Graph window icon is blurry and low quality when the Shader Graph is created using the Universal 2D template
- “Export HDRP Sky to Image” command error message does not indicate that Game view must be visible
- Adaptive Performance Settings Framerate field doesn't display the "supported without VSync" warning, when the field is collapsed in Build Profiles
Zullar
Oct 07, 2015 23:03
Code to replicate bug
http://forum.unity3d.com/threads/command-inheritance-heirarchy-index-mismatch-bug.359772/#post-2329645