0

I want to control my models with an external app. The idea is that when the unity project is executed the project spawns a HTTP Server with routes (just an idea) like IP_ADDRESS/MODEL_NAME/rotate.

Within the app I have some buttons. For example when I click the button "rotate" the app should send a HTTP request to the HTTP server which has been spawned by unity. When the server receives the request I want to rotate the object (in this example).

The unity project (or the executable) is always in the same network as the app. So these components only communicate within the same network.

Is this a suitable way to do this? Has C# already something like this build in? Or is there a better way to achieve this?

5
  • 4
    You need to use Unity3d Networking, the wheel is done! Commented May 18, 2016 at 14:16
  • HTTP on a device on same local network? Why HTTP? Are you trying to make a multiplayer game? Commented May 18, 2016 at 15:12
  • Thanks for your comments. @Programmer No, not a game. Some 3D-Models with animations which should be controllable via app. HTTP was just an idea but not necessary. Commented May 18, 2016 at 15:15
  • Thanks @joreldraw I will look into that! Commented May 18, 2016 at 15:15
  • 2
    If HTTP is an idea then do what Joreldraw suggested. Use Unity's networking called UNET. Tutorial is here forum.unity3d.com/threads/… Commented May 18, 2016 at 15:18

1 Answer 1

2

Actually, since Unity is built on .NET, you can just use .NET's native libraries. HttpListener is available as far back as 2.0, which is (approximately) what Unity uses. This link will take you to the documentation, which also includes examples:

https://msdn.microsoft.com/en-us/library/system.net.httplistener(v=vs.110).aspx

Cheers!

Sign up to request clarification or add additional context in comments.

1 Comment

Is that multi platform

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.