Hi Friends,
I am embarking on AR development and very excited about it. I am hitting a wall here though and think some code may need hacking to make Unity Remote use the Android Camera in the unity editor.
I have an S8 and the 2017.3.1f1 Personal Unity edition. Project is the simple ARCore HelloAR.
After fighting with the setup and tools fiasco, and fixing C# errors that spawn errors… I was able to build and deploy an APK.
Device Install worked. I was able to find surfaces and plant the little droid on surfaces. YAY!.
NEXT : Workflow, I can’t possibly build an app having to deploy an APK each time to test a few lines of code. This is where I saw on youtube “Unity Remote 5” from the Pirates AR dude. PERFECT!
So I installed and made the platform changes for the Editor to “Any Android Device”
THE RESULT:
Unity Remote shows what appears to be only the unity camera view. The solid blue background with the UI Label at the bottom that says “Searching for Surfaces”
*yes permissions were accepted at the start, and Unity Remote re-installed.
I had a look at the ARCoreBackgroundRenderer.cs and placed a debug message which is stating that when we run that it never gets a texture to set. This tells me that likely the only thing not happening is the Camera is not being used or an access / code select issue or bug.
private void Update()
{
if (BackgroundMaterial == null)
{
Disable();
return;
}
Texture backgroundTexture = Frame.CameraImage.Texture;
if (backgroundTexture == null)
{
[B]Debug.Log("backgroundTexture is null"); //the line I added[/B]
Disable();
return;
}
// This is just a snippet of the top of the update function
So I’ll try to dig deeper but right now the question is: Why is Unity Remote 5 getting null from Frame.CameraImage.Texture?
When I run from the Editor , I get the blue solid background with the “searching for surfaces” message on both the android device and the editor. I expect to see the Android camera as the background and image processing source.
Is there a mix up in the ADB device ports? does the video flow on different ports? how can I test / troubleshoot this?
I attached an image as well, you can see the stream of my log message.
THX!