UpdateSharedWorld

Parameters

None.

Description

Sends and receives Shared World traffic in a frame that does not update the shared world.

You rarely need it: UpdateWorld on the shared world does the network work for you, receiving other players' changes before the simulation and sending yours after it. Call UpdateSharedWorld in loops that do not call UpdateWorld on that world, such as a lobby or menu screen, or while another world is selected.

Calling both in the same frame is safe: the work is done once per frame. A frame ends at Flip (or FlipCanvas on the canvas that Graphics3DCanvas opened 3D graphics on), or every 50 milliseconds in a loop without either.

Remember to select the shared world with SetWorld before UpdateWorld. On the host, step any separate physics world with StepPhysics before UpdateWorld, so the new positions are sent the same frame.

For the full story - services, hosting, sharing and host migration - see the Shared World guide and its complete Shared_World_Playground.bb sample.


See also: SharedWorldState, UpdateWorld, SetWorld, RecvSharedEvent.

Index