Hi, I try to move two cube by two IMUs (mpu9250) that I control with an arduino mega. I send the euler angles from arduino to Unity by the serial communication and with the videos of Kapil Goswami in youtube I manage to move one cube with 1 IMU. Now I want to move two different objects with two IMUs but I do not know how I can do. I try to replicate the code that I used for the first object for the second cube but I obtain the error: “IOException: Access denied” because I try to open two times the serial port. I add the code that I udes for one cube. I think I have to control the two object with the same script but how I can do it? Can someone tell me how I can control different object by the same serial port?
Thanks so much:)
Here there is my Unity script.
3144905–238768–One_mputest.cs (1.94 KB)