use smartphone gyroscope as a controller

i started making a sword fighting game for pc that uses the smarphone as a gyroscope Controller for the sword.
does someone know how to do this?( only the Controller Thing)

thx

Yes. Write an app on the phone that reads the gyroscope/accelerometer input and sends it out to the PC.

You can use Bluetooth, USB cable, WiFi, infrared (if your phone has it) or whatever (smoke signals? Is it a Samsung maybe?) to get the data transferred.

Transferring the data from the phone to the PC is far outside of the scope of Unity directly, but there is full support for TCP/IP sockets so it is certainly doable.

1 Like

ok thank you