[Newbie Question] How do i send the position of my Player to the other clients ?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

[Newbie Question] How do i send the position of my Player to the other clients ?

Postby genar » 08 Dec 2017, 16:08

Good evening !

Im currently working on an little game. I already setted up the server, connected a databse to it and its working all fine for now. As the next step i want to make my player visible to other ones and also send the movement of my player to the clients.

Is there an easy example of how to do this ?
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [Newbie Question] How do i send the position of my Player to the other clients ?

Postby Lapo » 09 Dec 2017, 22:01

Hi,
you can use User Variables, which are custom values attached to each player that you can use to transmit state, position etc...

I would highly recommend downloading our Example Packs for the language you're using:
http://smartfoxserver.com/download/sfs2x#p=examples

And follow the relative tutorials from our docs website. For example this is the starting point if you're using Unity:
http://docs2x.smartfoxserver.com/Exampl ... troduction

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 72 guests