Start a new topic

Instant tracking: Making a target instead of the default grid and place objects at the target

Hi,


The default example of instant tracking, in Unity has a grid displayed, I assume where the floor plane is detected, on the entire plane.


I know we can remove this grid, from the GridRenderer.cs, line 22, remove RenderGrid(), but I would also like to add a target / crosshair instead, so the user sees that, on the floor, at the spot he is pointing with his camera towards. (like in the attached screenshot)


Can that be done? And also, upon adding the object to the scene, can those be added to the location that was targeted when initializing, instead of the camera position?


Thank you,

George

1 Comment

Hi,


Any object that you add as a child to the Trackable GameObject (which is a child of the InstantTracker GameObject) will be placed during runtime where the camera is pointing. So you can just place a quad for example as a child of this Trackable GameObject, make sure the local position is zero and that it is pointing up and it will act as a crosshair.


Also, any GameObjects that you add at runtime to the Trackable will behave the same way, no matter if you are initializing or tracking. So, again, if you create your object at runtime, place it as the child of the Trackable and set its local position to zero, it will appear on top of the crosshair.


As a side note, the Trackable GameObject never actually moves in world space, just the WikitudeCamera will position itself relative to it so that the augmentations look right. This means that you can have physical objects inside the Trackable and they will behave as you would expect.


Best regards,

Alexandru

Login or Signup to post a comment