Hi. I am trying to use this to connect an app running on an Oculus Go headset with an Android tablet, but they dont want to connect. Im starting off with the demo scene, starting one as the Server / one as Client, but the two apps dont find each other. I was expecting the AutoNetworkDiscovery would handle this? With my use case I wont be able to specify in advance what the IP will be, so I really need them to find each other automatically. On the Client the value for IsConnected switches to True for a couple of seconds and then reverts to False.
Am I missing something here? Thanks for any help with this.
okay, got them to talk to each other!
Just need to work out
how to send a snapshot of the current view from the client headset to the server tablet and
how to send commands from the server to client, for changing the scene, configuration etc (an RPC I guess?)
Are these both possible with this version, or should I be using the full pack (I bought both)
Many thanks
Thanks for your help, much appreciated! Asset looks great so far, clean code and well documented.
I can see how it all works when everything is in one scene, but Im having problems seeing how to keep the connection across multiple scenes. My project needs to switch scenes. I use SendToOthers() to get the scene switched, but then there is no connection to the Server in the next scene. I note in your demo project you dont change scene after AssignasServer/Client…
I have tried a couple of routes - adding a NetworkManager object to the new scene (fails) and using DontDestroyOnLoad from the init screen (also fails)
So, Im wondering if you know what the best practise is for keeping a connection with your network object between scenes?
Many thanks, and seasons greetings
Hi,
Thanks for the response.
I have started with your demo scene, and adapted it so that the Server / Client buttons go to a second scene using LoadSceneAsync.
The FMNetworkManager object is retained through to the second scene via DontDestroyOnLoad.
Unfortunately, the connection doesnt work. The IsConnected value switches to False after a couple of seconds on the second scene.
Is it not possible to retain the connection between scenes with your asset?
Hi,
Thanks for the reply.
I am testing on android phone (server) to oculus go (client) which didn’t work.
Then tried android phone (server) to pc (client) which also fails.
Really need to know if its possible to achieve this or not with your assets.
A sample project would be really helpful.
In FMNetworkManager.cs, please replace the Awake() with below script.
It’s tested on Macbook and works fine. and We will test on other devices soon.
//It also works when you switch scene with below function too.
//UnityEngine.SceneManagement.SceneManager.LoadScene(SceneName);
//Please be noted:
//DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
void Awake()
{
if (instance == null)
{
instance = this;
this.gameObject.transform.parent = null;
DontDestroyOnLoad(this.gameObject);
}
else
{
Destroy(this.gameObject);
}
}
Many thanks. I will try that today. I was using dontdestroy within my own script (finding the network object by name and then DontDestroyonload) so maybe that was an issue? Also, I wasn’t using loadscene additive, I am using loadasync.
I will make some changes and if that doesnt work I will send a mail to support.
Cheers guys
It’s non-reliable UDP. If you need reliable solution, will you consider TCP or WebSocket?
full pack: http://u3d.as/1uHj
we have live streaming examples in UDP/TCP/WebSocket.