- Home /
Question by
amjad freihat · Mar 01, 2015 at 09:01 AM ·
unity 4.6c# tutorial
how can compare the the character by ascii value ?
example if(input.getkey(keycode.A) == #65)
Comment
input.getkey(xx) will return true or false depending on whether the key is pressed or not - there's no additional checking to be done. check the docs.
Answer by tanoshimi · Mar 01, 2015 at 09:02 AM
void Update () {
if (Input.inputString != "")
{
int asciiCode = System.Convert.ToInt32(Input.inputString[0]);
Debug.Log(asciiCode);
}
}