Update Value VariableRoom

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

mers
Posts: 6
Joined: 20 Dec 2017, 16:17

Update Value VariableRoom

Postby mers » 20 Dec 2017, 16:32

Hello everybody,

I have a small problem on _room.GetVariable ("update_me_plz"). Value ("im_the_value") client-side
I update my RoomVariable on server-side ( to "im_the_NEW_value" ), and on smartfox i can see the variable being updated.. all is fine.

But now client-side back I restart the script _room.GetVariable ("update_me_plz") Value and is always the original value ("im_the_value")

Any idea ? thx to all and sorry for bad eng
User avatar
Lapo
Site Admin
Posts: 20054
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Update Value VariableRoom

Postby Lapo » 21 Dec 2017, 08:38

Hi,
you need to listen for the USER_VARIABLES_UPDATE event. When it fires on the client side the variable is accessible with the new value.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
mers
Posts: 6
Joined: 20 Dec 2017, 16:17

Re: Update Value VariableRoom

Postby mers » 21 Dec 2017, 14:56

Hi and thx for info,
Actually i change variable on client-side directly and this work fine.

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 1 guest