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! Your search result can be found below. Plus, we offer support via 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.

Send an array of int[] via RPC

HooDoo
2016-04-30 01:32:31

I need to send an array of ints via RPC
I tried the following, and it does not give an error, but the values do not get sent over properly:

int[] myints=new int[2];
myints[0]=0;
myints[1]=1;

photonView.RPC("sendints",PhotonTargets.Others,(int[])myints);
...
[PunRPC]
void sendints(int[] myints) {
myints[0]....says 0
myints[1]....says 0


anyone know how to do this?
I need to send array of vectors, floats and ints

Comments

vadim
2016-05-06 15:24:30

int[] will work same way as float[]: http://forum.photonengine.com/discussion/comment/28055/#Comment_28055

HooDoo
2016-08-19 18:50:43

Thanks for the reply!

Back to top