Smartphone to computer connection with different content

Hey,

I consider myself to still be a Unity beginner but I have a bit of technical background so I’m learning quite fast. What I want to do is to connect my smartphone to my computer and use it as an input device. I have already completed and modified the Multiplayer Networking Tutorial (https://unity3d.com/learn/tutorials/s/multiplayer-networking).

What is already working:

  • Have a network connection between phone and computer
  • Use the phone as input for the computer
  • Input from the phone changes the content on both phone and computer
  • phone and computer show an identical scene

What I need:

  • my scene is quite complex and I am not confident that my phone can handle rendering
  • Thus I want a different scene which is just the “phone environment”
  • I need a connection between those two scenes
  • Phone input includes rotation, movement and touch.

I have looked online for a while but all information I can find is either too advanced for me or does not fit. I would really appreciate a step by step tutorial on how to connect 2 different scenes on 2 different devices to each other using unity.

Another option might be to have both objects still in the same scene but to render most content only on the computer. I don’t know how that would work either, though.

I really appreciate any help or feedback!

Georg

The UNet networking HLAPI is not very friendly with regard to syncing two machines running different scenes (it was largely built with the assumption the client and server are running the same scene). Some people here have reported they are doing it, but you’re not going to find a step by step tutorial for it in any youtube video or online tutorial, nor is anyone likely going to be able to go through it all in a forum post for a beginner.

Whenever I do communication between machines running different scenes I use NetworkServerSimple instead of the full HLAPI’s features, and just use UNet Messages, but I’m not using that for syncing objects in the scene or anything like that. You’d have to build a lot on top of simple Messages, or if you directly used the LLAPI, for that to work for you. That’s a lot for a beginner.

Yes that sounds a lot, true. So do you think that using the same scene and just disabling rendering on my phone for most scene is the way I should try to go?

I would think that would work as far as performance, but I have no experience keeping these desktop computer targeted assets from getting into the phone build. I suspect your phone build would end up including all the assets you have references to even if you’re not showing them on the phone, which may lead to too large of a build than you want. I don’t really know what I’m talking about in that area, but its something you may want to be investigate how to optimize.

Ok thank you very much for your feedback and Ideas! I have seen other people use their smartphone as an input device before. Thus it has to be possible in some way. I will try and look into the approach of using one scene.

If anyone has experience in using a smartphone as a controller for Unity I would love to hear it!