Power up does not work on collision sometimes

Options
Hi folks,

I am new to Photon so maybe I do not understand something.

I have weird situation. I have power ups in my 2D game. And they are activated on collision. When I test it with two players, it works only for one player. For second player, power up pick up effect gets activated, on collision voice gets activated but script does not change which gives power up to player. Very rarely everything works fine for both players but rarely. So power up only activates for one player most of the time.

I tried many things. Can't figure it out.

I use if(photonview is.mine){powerupcode, pickup effect, pick up voice}
else if(!photonview is.mine){return}

Everything works except power up code. Which should access script attached to the player and change jump power value.

Comments

  • David818
    Options
    Okay, I figured it out finally.

    If anyone has same issue, seems like photon struggles to access script from another one. So, I put on collision code in the script which was giving it power up. In this why, I did not have to make any reference to another script so, it now works great