|
I'm using the following code to call my pause menu, which is in a different script and is invoked when pauseVisible becomes true. It worked perfectly until I added the Time.timeScale lines to pause the game. Now when I open my pause menu, clicking buttons does nothing (obviously because timeScale is 0!). When I press 'P' to resume the game, it carries out whatever action I had taken, such as loading a certain level. Since Time.timeScale seems to be the common method of pausing the game as far as I can see from the forums, has anyone else not been able to use their GUI buttons with this method? If it makes any difference, the print() statement I have to test the quit button still fires. Also, I tried putting all my code in the script that holds the gui stuff, but it doesn't work at all that way.
(comments are locked)
|
|
The time scale being 0 doesn't have any effect on GUI buttons, so the problem must be elsewhere. Incidentally, for toggling things, you can use code like: Thanks Eric, I'll have a look through my code. Yeah, thanks, I know you can, I just like to see plain English=S
Apr 16 '10 at 10:52 PM
straydogstrut
(comments are locked)
|
|
After scratching my head for ages finding nothing wrong i've discovered that I only reset Time.timeScale to 1.0 when pressing the 'P' key, but not when choosing an option in the menu. It wasn't until I commented out a yield statement that I discovered that the level was being loaded, but was not getting any further than my fade in script since time was at a stand still. I've added lines to set Time.timeScale to 1.0 after pressing the buttons and it works perfectly now. My full, revised code is: 0 I have tried this code, however it keeps saying unknown iditfier for MouseLook any ideas?
Apr 21 '10 at 11:37 PM
GeneralGadd
MouseLook is the script on the first person controller found in Standard Assets>Prefabs. In my case i've renamed my fps controller to 'player'. In your project, doublecheck which object it's on and what it's called. Also note that there are two MouseLook scripts (the other one is on the camera). I'm using two cameras in my game, hence the third line disabling cam2. If you can't get it working, maybe start a new question with some code and i'll have a look.
Apr 22 '10 at 01:42 AM
straydogstrut
(comments are locked)
|
|
I need help with a slightly different code:
I didn't make this code and I want to get rid of it and use the code posted above. I would be fine even if I could just get rid of the difficulty buttons and add a qiut to menu and a restart level button but for some reason, if I get rid of the code or even just the difficulty buttons, the game won't work properly. Any help is appreciated Thank you in advance (ps: this is for a 3rd person game and I only want one set difficulty witch is why I don't want the buttons.) Don't post your question as an answer to another question, this isn't a forum (Actually, in a forum you wouldn't even do that, either). Start a new question.
May 31 '10 at 11:18 AM
qJake
(comments are locked)
|
