Custom pointer not working in glass (w/ phone)

Hello,

I created a custom ray controller (like VR pointer)

  • Create new BaseInput script in EventSystem
  • Process UI event using StandaloneInputModule’s mouse system by making custom camera
  • Destroy Nreal’s BaseInputModule (NRInputModule) (★must)

It works on Unity Editor well,
But not working in glass.

Is Nebula app has own BaseInputModule and anyone cannot control this?
How can i destroy this like in Editor?

Please let me know T_T

1 Like

Hmm I have personally not done anything like this but this is what I would recommend that you do:

Download ADB (Android Debug Bridge). It should be installed together with Android Studio, otherwise you can get it here:

ADB for OSX: SDK Platform Tools release notes  |  Android Developers

To be able to run ADB from the command prompt, you will need to add ADB to the system variables. Edit the “path” variable and add a path to your platform-tools folder. For me it’s located by default at C:\Users<>\AppData\Local\Android\Sdk\platform-tools

ADB is needed to debug the NReal device (or any other Android device). This is usually done by connecting the device to the computer via cable. However, the glasses is also connected to the device by cable and you probably want to move around, so it is easiest to debug through wifi. To do this, make sure that the computer and device is connected to the same network, connect the device to the computer by cable, open the command prompt and run

adb devices (should show the device you plugged via cable)
adb tcpip 5555
adb connect << IP-ADDRESS >> ((Phone’s IP-adress) Now the device should be connected via wifi))

If the last command fails, try to ping the device
ping -t << IP-ADDRESS >>

When you get a valid response, there should be no problem to connect. If you don’t get a valid response, try turning wifi on and off on the device. This could take a while (~15 min if you’re unlucky).

If you’re successfully connected, you should be able to unplug the cable and run adb devices, and the device will show up like << IP-ADDRESS >>:5555.

The IP-address can be found under Settings > System > About Phone > Status

Download the android logcat package from the package manager. It lets you log errors from android devices

Now, for the actual building and debugging you’re going to want to

  1. Connect to compute unit using wifi. Select it in build settings as target (you might need to hit refresh). Set a new buildnr in appname so you know for sure it is the updated build.
  2. SaveAll in Visual Studio. And Save in Unity.
  3. Build and Run (!). Check that it is totally completed before starting.
  4. Make sure the permissions is set, otherwise use scrcpy to enter android settings…
  5. In visual studio you can attach the process to Unity, then you can use breakpoints to step through code.
  6. Use Debug.Log(“msg”); a lot.
  7. When getting tracking of the floor, look still at the floor for 3 seconds.

Now when you use the app on the phone with the glasses connected to the device, you should see a bunch of msgs and errors come up on the android logcat monitor. I hope you manage to find the issue, keep this post updated with whatever you find! Somebody else might be able to help you out further. Good luck friend.

Thank you for your kind reply :grinning:

I checked the log through debugging, but it is still difficult to find the problem.
I suspect a problem with Nebula App<->NRInputModule… I’m looking for an answer!

No worries man! If you happen to come across any type of error you find interesting, make sure to post it here! Keep this thread alive, somebody might me able to help you out further :raised_hands:

When initializing NRInput, NRInputModule will be created and turn to DontDestroyOnLoad. It is not recommended to destroy NRInputModule as some unexpected issues may occur. Can you try disable this or assign other InputModule in EventSystem otherwise?

3 Likes

Thank you for your reply.

I tried - NRInputModule disable + custom InputModule activate - process,
But it still not works in glass T_T (well done in Unity Editor)