Rpc parameters

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Rpc parameters

Zeohack
2021-06-30 07:49:46

hi.. I've been dealing with rpc for a while, but I couldn't figure out how to write method parameters, especially piece and Vector2Int gridpoint parameter method, how should I write them when calling the method with rpc? I will be glad if you help. here are my codes..

MoveSelector Script..

Gamemanager Script...

Geometry Script...

Comments

Tobias
2021-06-30 09:47:20

Vector2Int is not a type that PUN de/serializes out of the box. It needs to be added as custom type (or you use Vector2).

What are the issues you run into?

Zeohack
2021-06-30 09:56:27

I need to use the gridpoint parameter to call the method, how can I add it as a custom type?

Tobias
2021-06-30 15:39:12

Have a look at CustomTypesUnity.cs. It registers a few types of Unity as custom types for Photon.
There is also a doc about serialization in PUN.

Zeohack
2021-06-30 15:42:34

thanks I think I need to adapt it to my project as Vector2Int by looking at Vector2 examples

Back to top