PUN wont work on android

Options
I am currently new in using PUN. I tried to use the DemoRPGMovement-Scene to help me with a game that Im making for a school project. It was working fine in the Unity Editor, but when i tried to run it on an android device, it wont work. It's stuck in Connecting to a peer. Please help me. Thanks !

Comments

  • jeanfabre
    Options
    Hi,

    I would change the photon settings. what hosting do you have? PhotonCloud or bestRegion ( where all regions are enabled): try to swap between the two when deploying to Android.

    Bye,

    Jean

  • o0Holic0o
    Options
    Im using PhotonCloud.. The regions im using are Asia and Jp. But still I'm encountering the same issues
  • jeanfabre
    Options
    Hi,

    are you using IPV6 connection on your mobile? what version of Unity are you using to publish?

    does it work when you publish on your computer as a desktop app?

    Bye,

    Jean
  • o0Holic0o
    Options
    Hi,

    I already resolved this issue, i updated my PUN asset. Thanks for the help!
  • jeanfabre
    Options
    Excellent :) it's good when things get sorted easily :)
  • o0Holic0o
    Options
    Yeah. Good thing I checked the asset store. But now I'm getting a new error when I added a function that will decrease the HP of the player when the enemy gets a score. Hahaha
  • jeanfabre
    Options
    Hi,

    what error is it?

    Bye,

    Jean
  • o0Holic0o
    Options
    Well it's not actually an error.. I cannot get the score of the player to decrease the value of the enemy's Hp Slider.. well, it does decrease it, but it turns to 0 right away. I set the enemy's HP slider value to 200, and for example the player makes a score of 10, it doesnt make the enemy's hp slider to 190, it instantly becomes 0. I don't know what's wrong with the code.

    I use this function from the PunPlayerScore class. then i added the score variable to it.

    public static void AddScore(this PhotonPlayer player, int scoreToAddToCurrent)
    {
    int current = player.GetScore();
    current = current + Thinksquirrel.WordGameBuilderExample.MultiplayerView.scoreToAdd;

    Hashtable score = new Hashtable(); // using PUN's implementation of Hashtable
    score[PunPlayerScores.PlayerScoreProp] = current;

    player.SetCustomProperties(score); // this locally sets the score and will sync it in-game asap.
    }


  • jeanfabre
    Options
    Hi,

    you should put debug logs and check on the Unity editor what happens. We are not aware of any issues with setting properties gone wrong that bad. There is no code change, apart from the photon update on that project?

    Bye,

    Jean