How do I Multiplayer animations?

0 favourites
  • 4 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • Ok, so i'm having actual nightmares about this.

    I've got a 1 v 1 multiplayer game. I'm trying to add another object 'Sprite_Anims' to play animations for the main player object 'Sprite'.

    To change the animations, i am using the player inputs to send messages. The messages change variables on the Player object 'Sprite'. so if 'Sprite' variable 'Attack' = 1, the object 'Sprite_Anims' should play 'Attack' animation.

    I've tried approaching this the same way as i did with the player object, by assigning the Multiplayer ID's to a variable 'Player_Name'.

    This works fine with the player object 'Sprite', each instance gets assigned the correct ID, and the variables are set accordingly to the input messages.

    However, the animation object 'Sprite_Anims' is haunting me. It appears that the variable 'Player_Name' isnt being properly set to the Multiplayer ID's, and im not sure why. It looks like both instances are assigned the same ID.

    If anyone could take a look and point me in the right direction, then maybe i could be sane once again.

    Thanks.

    imgur.com/MFvHkp6

  • Basically need a way to give the 'sprite anims' object the same 'player_name' variable as the 'Sprite'. so that when 'Sprite' changes variables, it changes the associated 'sprite_anims' variables too. Which in turn play the animations. stumped.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Objects related to the multiplayer, on creation, simply give them the same PeerID.

    This way, when a peer is referenced, you can use that same reference for the other objects.

    you could then use a synched object variable, to determine the animation playing.

    Or have the client changing its animation simply forward this information to the host and peers, so they can change the animation accordingly.

  • Thanks for the help yet again! However i decided to go with the lazy route, and just use the objects i already have synced. all animations have the same collision size/shape so it shouldnt be too much of a problem!

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