The name does not exist in the current context

Hi Muhammad,

The issue is that you have Keycode instead of KeyCode, note the capitalisation.

Just as a heads-up, screenshot are really useful for error messages and details from the Unity editor, but for code it is much better if you copy/paste it into your posts and then apply the code formatting characters.

Several reasons for this, readability being one, for example at the moment I am replying from my mobile and it’s not easy to view the code in your screenshot. Another is that it’s easier and quicker for those who offer to help you to copy/pastr part of your code back to you with suggestions/corrections than having to type it all out. This increases your likelihood of a reply too.

Hope this helps :slight_smile:


See also;

Privacy & Terms