For the complete documentation index, see llms.txt. This page is also available as Markdown.

Troubleshooting

Summary

Symptoms you may run into while building with Reactor, what usually causes them, and where to read more. For problems with how server scripts are compiled, such as errors that look like a missing Reactor installation, see How Server Code Is Compiled.

The client connects, but nothing happens

The connection succeeds, but the game never starts: no entities spawn, a "waiting for players" state never ends, or RPCs get no reply. Usually the server script that should run isn't attached, so the server room has nothing to do.

  • Select the room object and check that your server room script's proxy is on it. Do the same for entities whose server scripts don't run.

  • If you created the server script by writing the file yourself rather than from a Reactor menu item, it has no proxy until the server runtime is built. Build it (CTRL+F3), attach the script, and build the scene configs (CTRL+F2). See How Server Code Is Compiled.

  • Rebuild the scene configs after attaching or changing server scripts, or the server keeps running the old configuration.

  • Check the server logs ('Menu Bar->Reactor->Local Server Logs') for exceptions thrown from Initialize.

The connection to 127.0.0.1 is refused

A connection in the ksConnect component's LOCAL mode fails with REFUSED or TIMEOUT, or the logs show a refused connection to 127.0.0.1:<port>. LOCAL mode connects to the 'Local Server Port' of the room type on this machine, and nothing is listening there.

  • Start a local server for that room, or launch the local cluster, before entering play mode.

  • Check that the port the server uses matches the room type's 'Local Server Port'. Each room type has its own.

  • If you meant to connect to a room you published, set 'Connect Mode' to ONLINE on every ksConnect component the client uses. A lobby and a game room each have their own setting. See Connecting to a Room.

The client joins the wrong room during local testing

In local testing, the client reaches a room other than the one you launched, or a lobby never responds while a game seems to run on its own. A local server left running from earlier testing still holds the port, and takes connections meant for the new room.

  • Stop standalone local servers before launching the local cluster, and stop the cluster before starting standalone servers. The 'Local Server Logs' window marks running servers with a '*' in its log list.

  • Check the server logs of the room you launched for errors about opening its ports.

  • The local cluster gives rooms ports from its 'Room Ports' range, starting with the launch room. See the local cluster notes in Tutorial 9.

Cluster requests fail with "Not connected to cluster."

Cluster.StartRoom, Cluster.GetRoomInfo, and other cluster requests complete immediately with this error, or cluster properties are never read. A room connects to the cluster after its scripts initialize, so Cluster.IsConnected is always false in Initialize. Make cluster requests from an update once Cluster.IsConnected is true. See Tutorial 10.

Connections fail with AUTH_ERR_USER_DEFINED

One of your server room's Room.OnAuthenticate handlers rejected the player by returning a non-zero code. The code and any data the handler returned are in the connect result's Code and Data. See Authentication.

"Cannot set a player controller without an owner."

A server script called SetOwner with a null owner and a controller. A player controller needs an owner. For entities driven by server code, such as bots or NPCs, make a virtual player the owner. See Ownership and Authority and Virtual Player Bots.

A player's entity loses its controller

After a change of owner, the entity stops responding to input. The one-argument SetOwner(player) removes the entity's controller. Pass the controller to keep it: entity.SetOwner(player, entity.PlayerController, permissions).

The locally controlled entity climbs over objects, then snaps back

On the client, the entity rides up onto other objects or leaves the ground, then returns to where the server has it. The client's predictor slides the entity along the surfaces it touches, and rigidbody constraints don't apply to predicted movement. Constrain movement in the player controller, and constrain the predictor's moves with MoveCheck. See Configuring the Converging Input Predictor From Code.

A camera following an entity jitters

Read the entity's transform in LateUpdate and don't smooth the camera's position on top of the predictor's smoothing. See Following an Entity With a Camera.

Last updated