x


How do I make a pause menu?

I have no idea how to make a pause menu. I want to make my game have a cursor lock but have the ability to unlock it by pausing. I use javascripts but C# and the others are fine if needed

more ▼

asked Nov 23 '10 at 01:58 AM

23cool1234 gravatar image

23cool1234
81 4 6 14

I suggest searching the forums and Unity Answers for 'pause' or 'pause menu' (this comes up frequently - there are even some example scripts floating around).

Nov 23 '10 at 09:58 AM Jesse Anders
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

copy and paste that code then apply it to the button

http://unity3d.com/support/documentation/ScriptReference/Screen-lockCursor.html

more ▼

answered Dec 08 '10 at 03:31 AM

Zachary gravatar image

Zachary
156 11 12 23

Apply it to what button? Can you be a little more more specific?

Dec 14 '10 at 07:47 PM 23cool1234

the start game button. so like play game or options or quit game if there is play game on your menu then drag the script to that text box and when you click the button in game it will play your game and lock your cursor and if you hit esc then it will appear again.

Dec 19 '10 at 04:34 AM Zachary

Thanks for the help

Dec 20 '10 at 07:03 PM 23cool1234

No problem.. (=

Dec 21 '10 at 11:49 AM Zachary

just let me know if you need any more i help i would be glad to try to help!

Dec 23 '10 at 06:12 AM Zachary
(comments are locked)
10|3000 characters needed characters left

Well, you can unlock the cursor anytime with Screen.lockCursor = false; As for the menu, I guess taking a look at GUI in the docs might be enough.

more ▼

answered Nov 23 '10 at 02:16 AM

OmegaVemon gravatar image

OmegaVemon
177 28 31 40

(comments are locked)
10|3000 characters needed characters left

You can also just hide the cursor and show it on your pause menu :

Screen.showCursor = false;
Screen.showCursor = true;
more ▼

answered Aug 29 '12 at 10:20 AM

awesome alex gravatar image

awesome alex
16 3 4 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3570
x402
x268

asked: Nov 23 '10 at 01:58 AM

Seen: 3907 times

Last Updated: Aug 29 '12 at 10:20 AM