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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

RigidBody and Network + Testing suggestions

Discussion in 'Multiplayer' started by dklompmaker, Sep 21, 2008.

  1. dklompmaker


    Sep 12, 2008
    Hello all!

    I have a very simple (And when I say Simple I mean it) networking project in which a blank unity scene initializes a server, and then a second app "client" connects to that server and then Network.Instantiates a player prefab. Now the problem I am having in testing... is that when the app is in focus.. or selected then it runs... but in order to update the scenes the server has to be in focus to process all calls.. so in my question.. I have two clients that the end result of the objects are two very different positions on both screens.

    2 clients both network create a box with rigid body.
    on both separate apps. The end result is different when they collide.
    Shouldn't they be the same?
    How do you test a server/client situation on one computer when the app has to be in focus to see the the realtime results?
  2. jashan


    Mar 9, 2007
    By calling Edit / Project Settings / Player, you get a list of settings in the inspector. There's one item "Run In Background". Make sure this is checked for networked games and servers ;-)
  3. shaun


    Mar 23, 2007
    One of the guys in our team has done a lot of networked physics dev in Unity, and from what I remember, PhysX in Unity is non-deterministic. This means given the same simulation inputs, the same output is not guaranteed. You probably need to consider synchronizing the simulation state using the server.

    Have a read of this, it's a great article on Networked Physics for Mercenaries 2.