I need a script to turn off all of a certain script, the MouseLook script. Can anyone help me?
Probably something like this:
var allObjects = FindObjectsOfType(GameObject);
for (var go : GameObject in allObjects) {
if(go.GetComponent(MouseLook)){
go.GetComponent(MouseLook).enabled = false;
}
}
It works!! but i had to do some editing, like making allObjects an array, and some other stuff
Yeah sorry I just typed it off the cuff… I figured with javascript’s dynamic typecasting it would have automatically made allObjects an array, though?
Edit: yeah I just tested it, it does.