Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » HELP » Help (General) » Help creating a pause menu[Script Available]

Help creating a pause menu[Script Available]

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Help creating a pause menu[Script Available] on Tue Jul 19, 2016 9:04 am

Natsuki Subaru


Member [Lv. 1]
Member [Lv. 1]
Hello guys I have this problem with this pause menu script where I just want to put buttons simply just put a menu button and retry button. And if possible disable mouse look. Thanks really appreciate ur help guys!!


Code:
var paused : boolean = false;

function Update () {

 if(Input.GetKeyDown("p") && paused == false) {  
 paused = true;  
 Time.timeScale = 0;
        }
        else if(Input.GetKeyDown("p") && paused == true) {
                paused = false;
                Time.timeScale = 1;
       }  
}

View user profile

PitbullM


Member [Lv. 3]
Member [Lv. 3]
GetComponent<MouseLook>().enabled = true;
GetComponent<MouseLook>().enabled = false;

Wink

Code:

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityStandardAssets.CrossPlatformInput;
using UnityStandardAssets.Utility;
using Random = UnityEngine.Random;
using UnityStandardAssets.Characters.FirstPerson;
...
public GameObject player;
...
void Update (){
...
player.GetComponent<FirstPersonController>().GetComponent<MouseLook>().enabled = !player.GetComponent<FirstPersonController>().GetComponent<MouseLook>().enabled;
...
}

Otherwise watch this

http://answers.unity3d.com/questions/555710/script-to-disable-mouselook.html

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum