Move the character Problem

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
MaHoNe
Posts: 8
Joined: 20 Oct 2018, 11:07

Move the character Problem

Post 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
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Move the character Problem

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
MaHoNe
Posts: 8
Joined: 20 Oct 2018, 11:07

Re: Move the character Problem

Post by MaHoNe »

Thanks, I'll try it
For the platform I use Smartfoxserver pro with flash
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Move the character Problem

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply