Problems with SetCustomProperties

Options
According to what I looked up online, most of the examples take in one parameter which is a single Hashtable. However, I kept getting an error saying there is no overload method that takes only one argument. It requires three. This is the example I came up with but I still get an error saying it has invalid arguments.

How do I use room.SetCustomProperties?

public void PlacingStone ()
{
Hashtable setPlacingStone = new Hashtable {{ RoomProperties.PlacingStone, true }};
Hashtable currentValues = new Hashtable {{ RoomProperties.PlacingStone,
(bool) PhotonNetwork.room.customProperties [ RoomProperties.PlacingStone ] }};
PhotonNetwork.room.SetCustomProperties ( setPlacingStone, currentValues, true );

StartCoroutine ( "WaitOnStone" );
}

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited May 2016
    Options
    Hi @Clossius,


    You can use PhotonNetwork.room.SetCustomProperties with one argument only (Hashtable).

    Maybe you need to use Photon's Hashtable (ExitGames.Client.Photon.Hashtable) instead of default Hashtable (System.Collections.Hashtable) Please add this on top of your file:
    using Hashtable = ExitGames.Client.Photon.Hashtable;


    Otherwise, your code seems correct to me.
    Can you provide more details, what's the exact error or warning message from your IDE, which line? a screenshot maybe?
  • Clossius
    Options
    Thanks that worked perfectly!