- Home /
Trouble getting key down to work
I have a script that will build something if the player is near and if he presses a button (The E key on keyboard)
Ive taken the script apart and realized that the problem is entirely on the getting the key down part.
This may be a simple fix, I am still learning. Here is what I have so far... The inRange bool works perfectly however the get key down part does not work at all. I tried reading the documentation and figured this was the best way to do it.
void update ()
{
if (inRange == true && (Input.GetKeyDown (KeyCode.E)))
{
Debug.Log ("You Pressed E in range");
}
}
Answer by jamessykwan · Dec 28, 2017 at 04:36 AM
The u in update should be capitalized.
Oh wow.... Thank you so much I cant believe I missed that!
Your answer
Follow this Question
Related Questions
GetKeyDown(KeyCode.Space) not working!? 3 Answers
Trying to make character move like frogger 0 Answers
Too many keys?! 1 Answer
Simple Quick Question 2 Answers
Problem With else if statement 1 Answer