- Home /
Question by
FlammingFart · Mar 30, 2013 at 09:31 PM ·
pausedisable
script from another
how to disable a js script using other script.. like when you pause the game, the player cannot shoot.. thats what im aiming, ill disable that script (shootscript)
Comment
Answer by $$anonymous$$ · Mar 31, 2013 at 10:21 AM
you can disable scripts by using this:
var Script : theScript;
Script = GetComponent(theScript);
Script.enabled = false; //disables the script
you will need to modify this a bit. you have to change "theScript" to the name of the script you want to disable in this case, if you script's name is "gunScript" that would be
var Script : gunScript; Script = GetComponent(gunScript); Script.enabled = false; //disables the script
ohh thanks for answering.. ill try it later :) just have ti take a break
Your answer
![](https://koobas.hobune.stream/wayback/20220613095403im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Animation Problems 1 Answer
Enable/Disable shader on script 2 Answers
Retaining Reference to Singleton GameObject 1 Answer
disable a script c# 3 Answers