|
how would i make it so that when i pressed lets say 'P' it pauses the game and a button pop up saying exit and obviously when you hit exit it exits the the menu and when you hit 'P' again the menu disappears if anybody could help me it would be a big massive help, I have try this code below but all it does is exit the game an start function Update () { } im doing a school project and i need it done soon :( and if you like i would put you in the credits ?
(comments are locked)
|
|
Alright when you press "P" you should have the button appear, not the Application.LoadLevel stuff because that loads the level when you press "P". When you press "P" you should set the timescale to 0 and instantiate a button. On the button you should have a script with a OnMouseDown function and have that have the Application load stuff. If you have any questions just ask I'll be happy to help. i know this sounds really cheeky but could you put that in to some sort of code because im not a coder as you can see :P so could you please help ??
Jan 15 '12 at 04:53 PM
benjimazza
If you are not a coder. Why are you coding then? :P
Jan 15 '12 at 05:40 PM
OrangeLightning
its always good to try, I know the smallest bit of code but not loads :P
Jan 15 '12 at 06:33 PM
benjimazza
(comments are locked)
|
This script draws a button when the game is paused(press "p") and if you click it, it will load the Main Menu. A basic example. I am not keen doing your homework, but I hope you'll learn something from this. Code is not tested and is meant as an example. this works perfect :) thanks,,, erm its not actually homework :D it sounds that way because it was for school but its not homework :) although you might not want to be im putting you in the credits because you wrote this code :L might sounds sad but thanks
Jan 15 '12 at 06:38 PM
benjimazza
No, problem señor ;) I wish we had projects like this at my school.
Jan 15 '12 at 07:20 PM
OrangeLightning
So are you cool with me putting you in the credits, and well.. get a petition or something going :P (to be able to do projects like this at your school) ;-) Once again, thank you.
Jan 15 '12 at 08:06 PM
benjimazza
(comments are locked)
|
