# SerialPort() data reading slowing down Unity

I am sending a few data from Arduino Uno to Unity using serial Port, baud rate is 115200. Still Unity is response time is pretty poor.

At first it takes fraction of seconds to process, but as time goes response time increases a lot.

What can I do ?

Is there a better way to send data ? I have heard using byte[] will be very helpful. Can anyone please tell me how to send Vector from Arduino as byte & recieve in Unity, if actually possible.

As I said I will open-source the project. Take a look.

• Welcome to GDSE. It would help if you could edit your question to include more information. For instance, how you are reading the data into Unity, how are you sending it, approximately how much data are you trying to move & what is your expected throughput rate? If there's too much code, you might need to make an Minimal, Complete, and Verifiable example. – Pikalek Apr 1 at 18:25
• There was just three variables, I was sending them with a : separation . But that was slowing down, so I slowed down Arduino & used Quaternion.Lerp in Unity, pretty smooth. – Maifee Ul Asad Apr 2 at 10:08
• That's a bit more information, but it's still not enough for someone else to replicate the problem, which in turn makes it difficult to offer meaningful solutions. For instance, different variables have different implications for data transfer (i.e. a single int versus a 20MB int[]). It seems that you've found a solution - please consider editing both to provide enough information to make them useful to others. – Pikalek Apr 2 at 13:55
• @Pikalek I am doing a varsity project, after submitting , I will surely open-source the whole project .. Then I will provide a link... Btw, you guys can wish me luck.. :p – Maifee Ul Asad Apr 2 at 14:28
• Links are nice & it's great that you want to open source your project. However within the Stack Exchange model, good questions & good answers need to be self contained enough to be useful to others. – Pikalek Apr 2 at 14:52

I have changed the dalay in Arduino. Then used Quaternion.Lerp in Unity, works pretty well & smooth for me.