How do I Sync Touched on Sprite in Multiplayer game?

0 favourites
  • 5 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • Hi,

    In my game there are 2 players created by Host and assigned ID = Host ID and Peer ID. In order to moving player, I use condition "On Touched Player" (with Host ID/ Peer ID).

    For Client, I tried Add Client Input (TouchX) and (TouchY) and Set client Input as following events

    + Touch: Is in touch

    -> Multiplayer: Set client input state "InputX" to value Touch.X

    -> Multiplayer: Set client input state "InputY" to value Touch.Y

    However, in Client's Game, How can I add "On Touched Player" (with Peer ID). I tried this but didn't work

    + Touch: On touched player

    ----+ player: [X] PeerID = Multiplayer.HostID

    -----> player: Destroy

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • A peer needs to tell the host either where it touched or what it touched, and the host does the syncing. The host then needs to relay to all peers that a particular object is associated with a peer, and all peers need to also associate that object with the peer.

  • My question is how to tell? Could you please guide me?

    I just succeeded with Set position of Player to Touch.X/Touch.Y from client's input.

  • If the host can get client input, then it knows where the client touched.

    Check if there is an object overlapping at that point, and assign it to the client that made the input.

  • Thanks for your suggestion, will try that!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)