- Home /
Network.RemoveRPCs Problem.
I took this stright from the docs but it throws me some errors.
Code:
void OnPlayerDisconnected(NetworkPlayer player) {
Debug.Log("Clean up after player " + player);
Network.RemoveRPCs(player);
Network.DestroyPlayerObjects(player);
}
Errors:
Assets/Scripts/Managers/NetworkManager.cs(162,25): error CS1502: The best overloaded method match for UnityEngine.Network.RemoveRPCs(UnityEngine.NetworkPlayer)' has some invalid arguments Assets/Scripts/Managers/NetworkManager.cs(162,25): error CS1503: Argument
#1' cannot convert NetworkPlayer' expression to type
UnityEngine.NetworkPlayer'
Assets/Scripts/Managers/NetworkManager.cs(163,25): error CS1502: The best overloaded method match for UnityEngine.Network.DestroyPlayerObjects(UnityEngine.NetworkPlayer)' has some invalid arguments Assets/Scripts/Managers/NetworkManager.cs(163,25): error CS1503: Argument
#1' cannot convert NetworkPlayer' expression to type
UnityEngine.NetworkPlayer'
Answer by GeorgeJRaven · Jul 10, 2014 at 11:35 AM
You could have another class called NetworkPlayer that is interfering. Try changing NetworkPlayer player to UnityEngine.NetworkPlayer player
Your answer
![](https://koobas.hobune.stream/wayback/20220613114457im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
RPC setName() not working correctly 0 Answers
Problem with network flashlight 1 Answer
Unity3d Network - Cant See Connected Players 3 Answers
Network Instantiate PlayerPrefab Problem 2 Answers
RPC Call Mix Up Issues 0 Answers