Pragma strict (433846)

hi..
how to write this with ‘#pragma strict’ ???

gameObject.GetComponent ("AudioDistortionFilter").distortionLevel = 0;

thx a lot for a hint!

Most likely the problem is that distortionLevel is a float and your passing a double. Try:

gameObject.GetComponent ("AudioDistortionFilter").distortionLevel = 0f;

Note the ‘f’ at the end. Reading the console output should have told you this much and helped you fix this problem faster.

thx for your reply
the error is: ‘distortionLevel’ is not a member of ‘UnityEngine.Component’
i did find some similar problems because of ‘pragma strict’ and ‘iphone dev’ … but i cant fix my example…

gameObject.GetComponent.().distortionLevel = 0;

Also, don’t use strings in GetComponent unless you really need to.

Javascript doesn’t work that way. You don’t need to use “f” for floats, and that’s an int, not a double.

–Eric

thanx eric!