Screen Flash When Hit -- Error Help From Pervious Question's Answer

Hello. I am trying to make my screen flash red when I'm hit. I am following the first answer for this question: http://answers.unity3d.com/questions/24529/screen-flashes-red-when-taking-damage

I am getting an error though. I applied the given script, changing "GUITextureobjectname" on the 4th and 2nd to last lines to it's name in the Hierarchy. But I am getting this error:

Assets/Game Assets/Hit.js(15,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(int, float, float, System.Type)'.

and this error:

Assets/Game Assets/Hit.js(17,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(float, int, float, System.Type)'.

and I am unable to enter play mode.

I am calling the script with FlashWhenHit(); (outside of that script).

Can somebody tell me what I am doing wrong? Do I need to replace the value "float" for something, and if so, what?

Again, thank you! :P

-Keavon

EDIT

EDIT

EDIT

EDIT

EDIT

EDIT

Thank you for your answer, efge, and Marowi for helping me understand it.

I have fixed it and it got rid of the error, but now I am getting:

Assets/Game Assets/Hit.js(15,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(float, float, float, System.Type)'.

And...

Assets/Game Assets/Hit.js(17,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(float, float, float, System.Type)'.

What should I do now? I suck at scripting, and I have never really gotten outside the cardboard box with it, so to speak.

Thank you so much for you input!

-Keavon

The arguments of your function Fade are Floats and a GameObject,

so you should change the calls to this:

Fade (0.0, 0.8, 0.5, GUITextureobjectname);
Fade (0.8, 0.0, 0.5, GUITextureobjectname);