Skip to content

Commit d8d116f

Browse files
fix: disabling NetworkBehaviours instead of destroying them [MTT-4481] (#718)
1 parent b449a4d commit d8d116f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Assets/Scripts/Gameplay/Input/ClientClickFeedback.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void Start()
2323
{
2424
if (NetworkManager.Singleton.LocalClientId != OwnerClientId)
2525
{
26-
Destroy(this);
26+
enabled = false;
2727
return;
2828
}
2929

Assets/Scripts/Utils/NetworkOverlay/NetworkStats.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public override void OnNetworkSpawn()
7272
bool isClientOnly = IsClient && !IsServer;
7373
if (!IsOwner && isClientOnly) // we don't want to track player ghost stats, only our own
7474
{
75-
Destroy(this);
75+
enabled = false;
7676
return;
7777
}
7878

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
2424
### Fixed
2525
* Subscribing to a message channel while unsubscribing is pending (#675)
2626
* Using ```Visible``` instead of ```Enabled``` to make sure RNSM continues updating when off (#702)
27+
* Some NetworkBehaviours are disabled instead of being destroyed (#718) - This preserves the index order for NetworkBehaviours between server and clients, resulting in no indexing issue for sending/receiving RPCs.
2728

2829
## [v1.3.0-pre] - 2022-06-23
2930

0 commit comments

Comments
 (0)