Unity Crash on Rpc with NetworkStruct parameter
I have an Rpc with the following signature:
[Rpc(RpcSources.InputAuthority, RpcTargets.All)]
public void Rpc_Cast(TargetData targetData)
TargetData is like so:
[Serializable]
public struct TargetData : INetworkStruct
{
public Character target; //Character is a NetworkBehaviour
public Vector3 position;
}
Crash dump says "The thread tried to read from or write to a virtual address for which it does not have the appropriate access."
Does anyone have any clue about the problem or is this a bug?
Thank you
0
Answers
-
I solved it!
Apparently you cannot make a Component null check on an RPC Component Parameter.
For example in my case I would do if(targetData.Character != null)
0
This discussion has been closed.