Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Spawning objects that the player controls but uses physics

Discussion in 'Multiplayer' started by Poon-Moon, Mar 29, 2019.

  1. Poon-Moon

    Poon-Moon

    Joined:
    Jan 27, 2015
    Posts:
    8
    Hi,

    I have gathered so far that the server should take care of all physics that affect gameplay outcomes. I want to spawn an object(s) that the player controls, but the consequences are owned by the server in terms of physics outcome.

    Example, shove h'penny (half-penny?): Once the player shoves the object up the board with an initial force, they have no control over what happens to that puck afterwards, and I am thinking the server should manage the physics of all the 'on board' pennys / pucks so that each client get an accurate picture of where everything is.

    So I've created a ServerSide Spawner for these objects and simply allow the player to affect them via the client - so no need for uNet's netmanager's player spawn points?

    I may have completely misunderstood all this but not found the unity tuts very useful for this type of game.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Well Unet is deprecated, so I wouldn't use it in the first place.

    But, networked GameObjects in Unet other than the special Player GameObject don't use the player spawn points. Those are for spawning the players. The rest of what you said sounds fine to me.
     
  3. Poon-Moon

    Poon-Moon

    Joined:
    Jan 27, 2015
    Posts:
    8
    Yes I see it is deprecated, but cannot see what it is replaced with - so unless you are suggesting using Photon, what would yo use instead of uNet?
     
  4. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    You can checkout MLAPI, it's basically a more performant and feature rich alternative to UNET. The performance is unmatched from what I have found so far. It's pretty similar to UNET usage wise.
     
    Poon-Moon likes this.
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    There's a variety of 3rd party networking solutions available right now, including @TwoTen's solution. Between the below links you should have a pretty comprehensive list of what is currently available.

    https://forum.unity.com/threads/wha...of-available-network-solutions-assets.609088/
    https://forum.unity.com/threads/ben...dgren-miniudp-hazel-photon-and-others.512507/
    https://github.com/nxrighthere/BenchmarkNet/wiki/Benchmark-Results
     
    Poon-Moon and TwoTen like this.
  6. Poon-Moon

    Poon-Moon

    Joined:
    Jan 27, 2015
    Posts:
    8
    Thanks so much for your feedback both - tearing my hair out here and really appreciate you guys taking the time to answer.
     
    TwoTen and Joe-Censored like this.