is it possible to implement a level change not only by clicking on the server button, but also the client?

hello everyone. I am creating a multiplayer game and I need every player to be able to press a button at any time and the level will change for everyone. so far, it only turns out that the level change works only by clicking on this button by the server. how can this be implemented?

You need to call an RPC (remote procedure call) from the client to the server.
This has to be done in an object that is owned by the client (example player controller)

Create a custom event and mark it as run on server. Put your level change logic there hooking up the level reference / name as the functions input.

On ui click have the button contact your player controller and call the new level change function passing in the target level.

a) make sure you add a space after server travel right now you are sending the command “ServertravelOffice_level”

b) you can pass in the player controller to the event too to make sure it gets the correct controller.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.