Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to implement multiplayer into my pong game?

Discussion in 'Multiplayer' started by jkarateking, Jan 27, 2015.

  1. jkarateking

    jkarateking

    Joined:
    Dec 3, 2013
    Posts:
    127
    i have developed a 2D pong game that is 2 player (one player uses WASD and one uses arrow keys on same computer). I will be putting the game on my website. How would I implement multiplayer so players can verse eachover over the Internet?
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    This is really a very complicated subject. First thing to do is look into RPC calls over the network (look up unity RPC tutorial or something), which basically means you are sending a method/function and its parameters over the network to either specific clients or to all the clients that are connected.

    Start reading up on that, then maybe look into a few packages available on the asset store and other places (some are free) that help you do more with networking. But there is no straightforward answer other than "get to learnin' that stuff"!

    Good luck!
     
  3. aanimation

    aanimation

    Joined:
    Oct 23, 2012
    Posts:
    49
    Photon Network is best way to this problem,
    use RPC to send input by player to other player display
     
  4. sokki

    sokki

    Joined:
    Jan 31, 2015
    Posts:
    166
    Can I test-play your game? Even if its only 2 player at time beings.
     
  5. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    There are several options to set up your multiplayer. I would recommend most of all the 'authoritative server'. Check this out. Scroll down a bit to find my post describing the concept. The author of Forge also linked a tutorial video for the networking solution where you can start learning how to set up the authoritative server and all aspects of multiplayer.