Question - Code Trouble with multiplayer controls

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Etendo, Aug 21, 2019.

  1. Etendo

    Etendo Member

    Joined:
    Sep 28, 2017
    Posts:
    5
    Hey there, so I started this simple block game in GM2 and added lan to it. All that fully works, creating a server, connecting, ect, but I cannot figure out the controls for the other computer. The game uses the mouse, and it makes it the first player on both computers. Is there any way to identify the other pc as the second player? I tried using if device_mouse_check_button(0, mb_left), but no avail. The mouse wheel is also a bit difficult. Any help would be very appreciated. Thanks.
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,549
    Just because you have a connection, it doesn't mean input or anything else would magically fly over to the other machine. You should have learned from the get-go that you need to send messages for player input as well, not just instance information. Re-read whatever learning material you used, look up how to send messages with it, and use that whenever user input is triggered. Then read back those messages on the other side and replicate the input with it.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice