How do I Sync object destroy (multiplayer)

  • Hi there, sorry for my bad English, but please help me!

    I read all the topics on forum about sync object, but I didn't understand and I can't do what I want.

    I'm creating a multiplayer shoot game like the tutorial made by Ashley, but with a difference: this game got two teams, like a deathmatch. So, I've two different peers, teamblu and teamred and right now works all fine, except to destroy the peer killed.

    As you can see in the image below, I put a condition to destroy the peer when health is under or egual to 0:

    If I put this in the host group, the peer is destroyed for host and after circa 3 seconds will be destroyed for peer too.

    If I put this in the peer group, the peer will be destroyed for peer only..

    The hit method for bullet is similar, but works fine, so I think this depends on variable health

    Can anyone help me? I've tryed several solution, but without any result. Thanks!

  • Generally, a synched object needs to be destroyed on the host end, which gets reflected on the peer end a moment later.

    To smooth-en this a bit, I always use some logic to synch the health as on the host to the peers, and on the peer end, when the health would be gone, set the object invisible. (or other effect related to death) During its invisible moment it should get destroyed.

    Its actually some nifty camouflage for the lag time difference.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh thanks. Invisible on health under 0 seems good. I will work on this, I hope is the right solution! Thanks!

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