Enable Camera Image Effect on Button Down

Hi there, i’m new to Unity 3D and i have a small question to ask. I’m currently working on a 3rd Person Adventure and so far everything is going great. I’m not experienced in Javascript so please bear with me.

The code i’m requesting is that when i hit the any of the Vertical (Up/Down arrow) keys (in which the player moves forward), the image effect, Fisheye, attached to the camera enables while the player is holding the up/down arrow key. Once the player let’s go of the arrow keys, the image effect is disabled. May i please have the code to this? :slight_smile:

Thanks a bunch

If you want to pay someone to write the code for you, check out the collaboration forum:

http://forum.unity3d.com/forums/17-Collaboration

This is the scripting forum, where we help you write the code yourself.

You can use Input.GetKey or Input.GetAxis to detect key presses:

http://unity3d.com/support/documentation/ScriptReference/Input.html

Access other components including scripts:

http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

Once you have a reference to ‘otherScript’, disabling it is as easy as:

otherScript.enabled = false;
1 Like

Oh sorry about that. Thanks :slight_smile: