Greetings, I am working on a ping pong game, and can move the paddle with mouse but I wanted to move it with the help of my mobile phone sensors. Any help will be appreciated.
Unfortunately PlayCanvas has not yet got an API for the phone gyro and accelerometers.
That said, you can use the native API for this https://developer.mozilla.org/en-US/docs/Web/API/Detecting_device_orientation
Let me know if you still have some problems with this.
Sir I have made a project that uses Node.js and SocketIO in which i can sync my mobile phone and desktop webpage and move a rectangle in real time; Can I use that code in my playcanvas app in moving an object on screen?
Can you give me a sample code to move paddle in my project? As I am new to it I am bit confused
Just to check, do you want to move a paddle on the screen of the phone? Or use the phone as a controller to control a paddle on the desktop?
I want to move the paddle on the desktop screen using my phone as a controller Sir.
In that case, the way I would approach it is to create a webpage that the phone would open and that would take the phone orientation (using the API I linked above), connect to the server, the server then sends that information to the desktop page/app and moves the paddle accordingly.
Itβs pretty much the same code as you mentioned above with moving the rectangle.
Thanks steven I ll try and will come back to you