Page 1 of 1

Move the character Problem

Posted: 20 Oct 2018, 11:54
by MaHoNe
hi
I have a game that contains characters But When I move the character The rest of the players do not see this But I see that I'm moving
And the same for all players
Is there anything I can try on server side to solve this problem

Re: Move the character Problem

Posted: 22 Oct 2018, 08:21
by Lapo
Hi,
it depends on how you have implemented the movement.

A simple way to do this is to use UserVariables. These are custom variables that can be created for every players which are auto-updated for all players in the Room, meaning that if Player1 changes his UserVars all other players in the same Room will receive an update about it.

For instance: you can add an X and Y UserVariable to each player and these values will be broadcast any time they are changed via the SetUserVariableRequest() from client-side. This means that each game client will receive the other player's position changes and therefore they can be updated on screen.

You didn't mention which platform you're using. If it's Unity I'd recommend checking this tutorial:
http://docs2x.smartfoxserver.com/Exampl ... t-movement

If you're new to Room/User Variable check this documentation too:
http://docs2x.smartfoxserver.com/Develo ... -variables

Hope it helps

Re: Move the character Problem

Posted: 22 Oct 2018, 10:59
by MaHoNe
Thanks, I'll try it
For the platform I use Smartfoxserver pro with flash

Re: Move the character Problem

Posted: 22 Oct 2018, 12:54
by Lapo
Ok,
so for Flash I would recommend this tutorial:
http://docs2x.smartfoxserver.com/Exampl ... vatar-chat

And you can find the sources, together with many other examples, here:
https://www.smartfoxserver.com/download#p=examples

Hope it helps