Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.15k stars 435 forks source link

[Rpc(SendTo.NotMe)] sends messages for everyone instead of everyone-1 #2851

Open ZanderCode opened 8 months ago

ZanderCode commented 8 months ago

Description

I have a projectile function that triggers a knockback effect for local clients enemy. This function also propagates this action to all other clients via [Rpc(SendTo.NotMe)] rpc, so that the knockback can also happen on observing clients. All works well when the server performs this action - the knockback is sent to everyone. Everything is good. However, when the client tries this, the server receives the message twice.

I found this https://forum.unity.com/threads/rpc-method-with-target-notme-or-notowner-called-twice-by-host-server.1543835/ which attempts to solve the problem, but seems like a workaround instead of intended behavior.

fluong6 commented 8 months ago

Hi @ZanderCode We are pleased to inform you that this issue has already been fixed by our development team and it will be included in the upcoming release of NGO 1.9.0.

NoelStephensUnity commented 7 months ago

@ZanderCode NGO v1.9.0 is currently in our release process. If you wanted to verify this is fixed or grab the version for this fix before the package is added to the package manager registry, you can use the release\1.9.0 branch.