Jump to content
  • Advertisement
Adehm

C# Unity Photon C# basics

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!