Hi,
-
Basically I want one app to tell the other app what to do.
Specifically, the first app is controlled using a touchscreen and displays a 2D map which can be moved around. In the second App I have a 3D version of the same map with a camera in 3D space and I want to exchange the position of the 2D map with the coordinates of the 3D cameras target to move the 3D camera according to the 2D map position.
The thing I have tried so far is using UnityWebRequest.Post and UnityWebRequest.Get to write the 2D map postition into a text file on a local (XAMPP) server using a .php script in between.
Before posting the new position I am checking if the position has changed and only if it has, I am sending the new information to the text file. With UnityWebRequest.Get i am constantly checking if the position in the text file has changed and only if it changed it will update the 3D camera position.
It works surprisingly well, but every once in a while the 3D camera starts freaking out and jumping all over the place even though the 2D map isn't posting anything to the text file.
-
Even writing it down right now I realise it definitely doesn't sound like the best way to go about something like this but I really don't know which other way would be possible or how to optimize my existing behaviour to have a more controlled scenario without any hiccups.
-
Any help would be much appreciated. Please tell me if you need more detail.
Thanks in advance!
↧