Common problems
My inputs seem to work for a split second, but then they are reversed
Example: you press a spacebar, the player jumps for a few miliseconds but then teleports back to the ground.
This usually happens when you modify the game state immediately on player input, instead of sending your input through the IInputHandler
. This causes the server to overwrite your local changes on the next tick.
Remember
The only way for a player to modify the game state is through Player Inputs, sent and received viaIInputHandler
.
The input is jittery and feels unresponsive
Example: you press a spacebar and sometimes the player jumps, but sometimes this input is ignored.
Inputs are collected in IInputHandler
during Elympics Update, which happens during FixedUpdate
, not every frame! This means that you should avoid using methods like GetKeyDown
or GetKeyUp
.
Reconciliation happens every frame and kills my framerate
Example: the game starts and the framerate immediately drops and in the console window I see a lot of “Reconcilation” warnings
Your client is probably trying to predict something that is not predictable for them, like other player movements. Only use prediction on objects you control, or objects no one controls.
My input is visible in my game, but not for other players
Example: I press a spacebar and I see myself jump, but other players don’t see this.
Either you don’t send your input through IInputHandler
or you don’t synchronize its effects. Every input has to be sent using IInputHandler
, and the code that applies it in IInputHandler
must modify a custom ElympicsVar
or a synchronised component on a ElympicsBehaviour
, like rigidbody or transform.
The same object has different positions on connected clients
Example: two players ale playing football and the ball has a different position for everyone
This basically means that the position of this object is not synchronised. This can happen for a couple of reasons:
- This object doesn’t have an ElympicsBehaviour component
- This object has an ElympicsBehaviour component, but doesn’t have position synchronisation turned on
- You have some custom logic that moves the object that is not a synchronised input (see “My input is visible in my game, but not for other players”)
- You instantiated an object without using ElympicsInstantiate
- You tried to add the ElympicsBehaviour component dynamically to an existing object - this is not supported
- You created a new ElympicsVar instance after scene initialization - this is not supported
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.