|
So I'm having an issue that I didn't have in the previous version of Unity3d. I have a variable that I am using the += and +- operation on every time the user presses down on a specific key. All I want to do is add the value 1 but every time the key is pressed the variable gets the value 2 added/subtracted to it. I have debugged for Input.GetKeyUp() and Input.GetKeyDown() and both times the debug shows 2 outputs in the console. I'm not too sure what's going on. I have gone around the problem by just using a float and halfing everything but its a pain in the you know what. If anyone has a solution please help! Thanks, Austin
(comments are locked)
|
|
The
(comments are locked)
|
|
Perhaps the script is accidentally on more than one object? Sometimes it's not obvious what object(s) a script is on. An easy way to find them is to put a line of code in the script:
You could put this next to the increment/decrement code to see who is calling it.
(comments are locked)
|

That will have happened in 2.6 as well, my guess is you were just lucky with the number of events matching up each time