Wikitude

How can we help you today?

Unity instant tracking sample + debugging for android

v

vamsi g

started a topic
almost 2 years ago

Hi,
I'm trying to use wikitude instant tracking example and modify it to work on android.
How can I debug my code in unity so that I can see how my changes are affecting the UI? And also I'm not able to move the objects using mouse while running the scene on unity, how can I change this so that I can modify the example code and look at how it's working?
Thanks in advance

Wikitude Technical Support

said
almost 2 years ago

Hi,

Our Instant Tracking example should work on Android without any modifications. Do you have a specific issue when trying to run it or Android?

I'm not sure what you are referring to exactly with debugging. You can debug C# code when running in the editor, if you are using MonoDevelop or Visual Studio Code. Here is a tutorial on how to do that.

The reason why you cannot move the objects around in the editor is because the example code is using the Touch API from the Input class, which doesn't work in the editor. If you take a look at MoveController.cs, in the Update function, you will see at the start of the function the use of Input.touchCount and Input.GetTouch(0).

To get it to work in the Editor, you can either use Unity Remote, or change the Update function to use Input.GetMouseButtonDown(0) and Input.mousePosition instead.

Best regards,

Alexandru

v

vamsi g

said
almost 2 years ago

Hi Alexandru,
I'm trying to move the chairs so that they all face the table (please see the attached picture). I think I should be able to rotate the chair. How can i do this?
P.S: thanks for a prompt response :)
Thanks

Wikitude Technical Support

said
almost 2 years ago

Hi,

The rotation gesture is not implemented in the sample provided, only translation and scale gestures. I would suggest looking around the Unity forums on how to do this. Maybe this can be a starting point.