(SOLVED) P2P: Run something on only one client

I have the problem, that I cant assign user IDs to a object in my game. I want that every player gets assigned to a player object.

I think I would need one like host player, that manages everything. I was also thinking of putting the client plyer in like a client scene and the host player in like a extra host scene so I could execute different code on both machines, or I even thought about making 2 game clients, one for hosting and one for joining, but it was really hard and annoying to communicate with the different clients especially the other scene one. I did it with global variables and stuff, really inefficiant and annying to inplement.

Isnt there a more acurate way and less cheaty to solve that problem.

Thanks :smile:

Hi,
I haven’t used P2P yet, but I think you could show a menu Host a game/Join a game, and the player who clicks on Host gets a host=1 variable that displays a layer/layout to allow him to setup the game.

1 Like

Thanks, works perfectly! I just gave every user, that opened the create window the Variable Host = 1, and like you said, just used that to run different code. Thanks. :smiley:

1 Like