How do I use containers in multiplayer, and how do I sync a container?

From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • I'm trying to create a very simple peer-peer tank combat game where there is a different sprite for the hull and for the turret. the hull moves based on WASD inputs and the turret points at the mouse position and is pinned to the hull. the turret and the hull are put into a container. I sync both the hull and turret separately because they both accept different inputs to change their position and angle.

    The problem is; when a peer joins the game it creates an extra copy of both the host's hull and turret and the peer's hull and turret. the error only occurs on the peer's screen. on then peer's end, the turrets for the host are pinned to host's hull but one doesn't rotate, and the second hull created for the host is at (-1000, -1000). the turret 2nd turret for the peer spawns at the location that the peer's tank is created and the peer's 2nd hull is also at (-1000, -1000).

    So I have read all the multiplayer tutorials and looked over the multiplayer example "real-time game" multiple times and read the documentation for multiplayer, and as far as I can tell there shouldn't be a problem with my game. but there is.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When the host first sync it's basically sending a list of objects to the Peer to create

    -Hull

    -Turret

    The peer receives this list and makes a hull and a turret. The hull makes a companion turret for itself (since they're in a container), and the turret makes a companion hull for itself (same reason). This is why there are duplicates

    To fix this you'll need to remove the container and do things manually

  • Oh, I see now. Thank you.

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