- Home /
i cannot pass through game object data type on Photon rpc function why?
it seems just fine when passing through int,string and bool data type but not game object ,when passing through game object it will give me an error
Exception: Write failed. Custom type not found: UnityEngine.GameObject ExitGames.Client.Photon.Protocol18.WriteCustomType (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/Protocol18Write.cs:685)
you can see my script inside the attatchment that i gave you
Answer by Addyarb · Apr 10, 2020 at 04:27 PM
Due to size limitations and staying optimized, Photon RPCs don't allow you to pass something like an entire GameObject.
Here's the documentation on the supported types.
Instead, you can get the player by their ID and then reference their GameObject, or something to that effect.
Thanks,this is the solution that i have been looking for.
Cheers man
Your answer
![](https://koobas.hobune.stream/wayback/20220612231018im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Send gameobject through photon RPC 1 Answer
Photon RPC "DestroyRpc" function not found 1 Answer
Network RPC find sender gameobject 2 Answers