How do I SYNC Mouse click between peer to host

0 favourites
  • 2 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Hello Everybody I Have A Problem With Multiplayer. What I'm Trying to do is when the peer clicks a bullet will get shot out of the peer and all other peers and the host can see it. but the problem is how do I sync it? is there anyway I could make some way the host would know what peer and if the peer is clicking so it could create the object at the peer and sync it. any help would be great!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Assuming you've followed the multiplayer tutorial, the answer to your question can be found here. https://www.scirra.com/tutorials/915/mu ... ame/page-7

    If you have your inputs set up correctly, then the host can get the peer inputs using the multiplayer.peerstate expression. Then the host can proceed with actions per peer (creating projectiles, moving) depending on each peer's inputs. You bullet will also need to be set up ahead of time as a synced object.

    I'm going to add a bit of advanced info here, as I've gone through this process before, and I'm guessing you'll run into issues regarding lag compensation and input prediction like I did. Basically you'll want your synced, authoritative projectile to be invisible, and have a local representation of your projectile be displayed immediately for the peer which gets it's position corrected over time to the synced projectile. Otherwise the lag time for bullet creation and destruction is pretty horrendous even on a 0 latency connection because of the way interpolation is built in to the plugin.

    If you have no idea what I'm talking about, don't worry about it. You'll get there eventually <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

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