Advertisement Jump to content
Adehm

C# Unity Photon C# basics

This topic is 452 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

 

I was wondering if anyone knew how to simply send and receive an integer?

if (PhotonNetwork.isMasterClient) {

//send an integer

}

If(!PhotonNetwork.isMasterClient){

//receive integer

}

 

Share this post


Link to post
Share on other sites
Advertisement

Yeah I can’t get it to work. Was hoping someone would be able to get me a simple example of either making a stream or just adding to a stream before its sent and receiving it. Tried several different ways and can’t get anything to work even in the rare cases that I can write what I’m told without error it just wont do anything.

Edited by Adehm

Share this post


Link to post
Share on other sites

I haven't used Photon in a couple years but did you take a look at the demo (vikings IIRC) that comes with the package? IIRC that contained everything I needed to get it off the ground.

Share this post


Link to post
Share on other sites

Thanks a bunch cmac you lead me to the solution. This video explains it wonderfully for anyone else who would like to know how to add data to the stream.

Kinda weird how you have to drag the script from a component to make it observable; didn't find a way to just do it manually through the control as it only allows me to select a gameobject and by default it's transform.

 

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!