- Home /
Space bar press wont update
Hi there guys I'm having a little issue here and I was wondering if you could help me with the issue. Alright here is the issue.
function Update () {
if(Input.GetKeyDown(KeyCode.Space)){ print("space key pressed"); } }
The issue I'm having with this is when I have pressed the space bar it comes up space key pressed however it only comes up once and therefor does not update every time I press the space bar and it should since it is in the function update and I don't know why this is happening so can anybody help me.
Answer by Demigiant · Oct 18, 2012 at 01:13 PM
Input.GetKeyDown is fired only once, when a key is pressed. If you want to repeat an operation WHILE they key is pressed, you're looking for Input.GetKey.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
"Failed to update Unity Web Player" 0 Answers
How Do I Stop My Character From Falling Through The Terrain!? 1 Answer
Set timer to a specific time. 1 Answer