- Home /
Question by
KravenArk · Feb 17, 2013 at 04:28 PM ·
animationsstopallmake
Make ALL animations stop!
enter code here
ok so i have this script where i need to have my player stop moving and stop looking around when i press "p" and this brings up a pause menu. var gamePaused : boolean = false;
function Update () {
if(Input.GetKeyDown("p")){
if(gamePaused){
Time.timeScale=1.0;
gamePaused = false;
}else{
Time.timeScale = 0.0;
gamePaused = true;
}
}
}
function OnGUI(){
if(gamePaused){
if(GUI.Button(Rect(450, 170, 100, 30), "Quit")){
Application.Exit();
}
if(GUI.Button(Rect (450, 100, 100, 30), "Resume")){
Time.timeScale = 1.0;
gamePaused = false;
}
if(GUI.Button(Rect(450, 135, 100, 30), "Options")){
if(GUI.Button(Rect(450, 180, 100, 30), "Options")){
}
}
}
}
Comment
Answer by Paulo-Henrique025 · Feb 17, 2013 at 04:35 PM
Try disabling the player script.
player.GetComponent< PlayerScript >.enabled = false;
Sorry for the spaces, the guys who wrote the code of this site never used templates...
Your answer
Follow this Question
Related Questions
How to Stop all audio 10 Answers
Animations won't play on command 0 Answers
Audio Source question 1 Answer
Stop moving rigidbody but don't stop rotating 1 Answer
Enemy rams my player? 1 Answer