Search Issue Tracker

By Design

Votes

6

Found in

Issue ID

734257

Regression

No

Commands with duplicate names call wrong command.

Networking

-

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

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.