Pause Menu in Multiplayer Game ?

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Pause Menu in Multiplayer Game ?

ShinysArc
2019-03-12 18:02:10

Hello everyone !
I'm currently making the multiplayer part of a game and I came across a problem: I have to make a pause menu appear when the Escape button is pressed. However, when I click on this button the canvas appears but my player's eyes still follow my mouse and I can still walk, is there any way to disable the scripts of the player ?

Comments

OneManArmy
2019-03-12 19:55:50

Hi, in pause menu your cursor is unlocked, right?
So you can simply check your cursor state.
In your movement and mouselook scripts you can add something like:
if(Cursor.lockState == CursorLockMode.None) return;

Back to top