Animation in multiplayer game

  • Hi guys,

    I am making a game which has a Sprite named "PLAYER_HITMAN", for every 3 seconds the map spawns more guns to let PLAYERS pick up. What i want is if a PLAYER pick up a weapon, the weapon will be destroyed, the PLAYER's animation should change to handing gun state. I have synced PLAYER's instance variable "animation" and on HOST i write code like this:

    However, this only works on HOST's side, the HOST can see all peers and itself have picked up the gun, the the peer which picked up the gun doesn't know that they have picked up a gun. I don't know what's this problem about, thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You have added the tag "animation" to the variable sync, yet this tag is nowhere to be found from any client input.

    I recommend to remove that tag from the Sync event if you don't use it.

    Multiplayer scenarios can be very complex, so without any .capx file, it's basically impossible for us to tell on how you handle Host and Peers accordingly.

    Otherwise please provide more information on your current state of how you're handling everything.

    Please note that:

    Sending client input from any Peer will ONLY send them to the Host.

    You in most scenarios you send only physical Keyboard/Mouse input to the Host.

    Then let the Host handle what's going to happen.

    And to reflect all actions to all Peers, you then forward this information from Host to all Peers.

    If you don't do that, you're most likely only going to see what's truly happening on the HOST side only.

  • thank you for your response, i have fixed the problem yesterday and forgot to update, im gonna finish this project then update it soon incase someone will need

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