- Home /
Unknown identifier when turning off SSAO through a JS script
Hello. In my project, I want to add an option to turn off SSAO (image effect) through a menu. Here is what I get: Unknown identifier: 'ScreenSpaceAmbientOcclusion'. I'm completely sure that's the name of the script. Here's the code:
if(handlerObj.GetComponent(handler).selectedSs==0) {
GetComponent(ScreenSpaceAmbientOcclusion).enabled=false;
}
The script is attached to the camera, and so is SSAO, so this should work, but it just says unknown identifier. It might have something to do with the fact that SSAO is a C# script while all my scripts are JS. Does someone have a clue what the problem could be?
Answer by aafasfasdf · Mar 09, 2015 at 09:41 PM
So here's how it should be: if(handlen.GetComponent(handler).selectedSs==0) { GetComponent. ().enabled=false; } Now it works.
Your answer
Follow this Question
Related Questions
Disabling a Script with C# 3 Answers
C# GetComponent()... Not finding script problem. 1 Answer
enabled is not a member of UnityEngine.Component 1 Answer
Enable script on parent 2 Answers
distance script not working!!! 1 Answer