- Home /
disable/enable script js
I have a MouseLook script and an Attack scrip. I want to disable the MouseLook during the attacks. I looked in the forum but nothing works
function Update()
{
if(Input.GetMouseButton(0)){
GetComponent(MouseLook).enable = false;
Slice();
GetComponent(MouseLook).enable = true;
}
}
All I get is: BCE0019: 'enable' is not a member of 'MouseLook'. Thanks for the help.
Comment
Best Answer
Answer by Kiwasi · Nov 08, 2014 at 07:24 PM
function Update(){
if(Input.GetMouseButton(0)){
GetComponent(MouseLook).enabled = false;
Slice();
GetComponent(MouseLook).enabled = true;
}
}
Silly me. Anyway, thanks for help, the problem is solved.
Your answer
Follow this Question
Related Questions
Unable to enable script 0 Answers
enable/disable specific components 3 Answers
Turn Off/on culling mask by script? 2 Answers
Disable SCRIPT HELP!!!! 1 Answer