Server build vs editor breaks clients
Anyone ever seen discrepancies in their server build from the editor? When my game server is running in Unity Editor it works perfectly as do the N number of clients that are connected. However, when I run the server as a server build, the clients cannot move.
Looking through the logs I can see the server sending new positions and I can see the client receiving them and setting the RigidBody2D.MovePosition() via a breakpoint but the characters never move on the client. The rigid body is not kinematic, is simulated and does not have x/y frozen. Is there a maximum MovePosition can be called?
Again this works fine when the server is running in the editor, but the same client code fails when the server is in build mode. Any thoughts would be great.
Here is the code that I am using to update the position:
Debug.Log("The new position: " + position);
playerState.Rigidbody.MovePosition(position);
Debug.Log($"The post change postiion: " + playerState.Rigidbody.position);
The result of the above code is: The new position: (-10.8, -79.5) The post change postiion: (1.0, 0.3)
Here's a video of the problem: https://youtu.be/GZKdOLiq8Ls
Answer by xxchester · May 25, 2021 at 05:41 PM
I knew this had to be something very stupid and in the end it was. In the build settings it was building a default scene and not the map scene.
Your answer
Follow this Question
Related Questions
What BuildTargetGroup option is the right for a linux build? 1 Answer
there is no build fail but editor script doesn't work in build 1 Answer
Variations of MouseScrollWheel input not detected in build ??? 0 Answers
Extremely Low FPS in Editor, smooth in Build. how to fix? 3 Answers
Visualize BoxCast Rect 1 Answer