How to get numbers from an Arduino

Hi guys,
I have an Arduino that gives me the x position of a physical device connected to the Arduino. The Arduino is connected to my “game computer” thru USB and sends the x positions followed by enter/return key. Like this:
441… and so on.
I have managed to get keyboard input by creating a condition “when return key is pressed” → “Change the text of scene variable CurrentPosition = Text_Entry_Name.String()”.

–My first problem is to get a number from the text entry and not a string. I don’t remember how to convert a string to an integer :stuck_out_tongue:

–My second problem is that there seems to be a delay when moving my device around. It’s as if my game takes chunks of positions rather than taking every position one by one.

Do you guys have any ideas how to make the player in my game follow those position numbers (keyboard input)?



To convert string to an integer, try using ToNumber(string)

Thanks! That worked fine.

1 Like