Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Editor ARTrackable (until Unity AR Remote comes)

Discussion in 'AR' started by sasob8, Aug 26, 2021.

  1. sasob8

    sasob8

    Joined:
    Jul 11, 2017
    Posts:
    25
    Is there a way to manualy - in editor - create ARTrackable (ARTrackedImage, ARPlane, ARAnchor...), so that all the managers would put it in the list.
    For example ARTrackedImageManager has an action: ARTrackedImageManager.trackedImagesChanged with args: ARTrackedImagesChangedEventArgs (inside you have added, updated, removed list).
    I know you can create ARTrackable, but it is not read by manager, and you can't put it in the list manualy since it is readonly.

    My goal is to imitate that i found tracked image or a plane - in editor without building app.
    That would improve my development speed very much... Since we all know "Unity AR remote" is never coming :rolleyes:

    Thank you
     
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,073
    AR trackables are not meant to be created manually. AR Foundation manages the creation, lifetime, and destruction of all trackables based on events from AR providers.
    So the only way to create trackables inside Unity Editor is to create a custom AR provider that will supply AR foundation with the data about trackables. Thankfully, there are several products on the market that can do this, including my plugin :)
     
  3. sasob8

    sasob8

    Joined:
    Jul 11, 2017
    Posts:
    25
    Yes i have your plugin. It works good if i use it with the phone, but i don't know what kind of editor capabilities plugin has.
    For simple things i would prefer to play directly in editor without phone.

    What do you mean by "create a custom AR provider"? Do you have any more information where can i read about that? Is there a simple way to do that? I would appreciate any info or tip about that.
    Thank you :)
     
  4. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,073
    I can't say it's simple because this method requires creating a lot of scripts.

    The 'XR Plugin Management' has a sample of creating a custom AR loader (provider).


    After creating a provider, you can register your custom XRPlaneSubsystem subsystem and supply mocked AR data via the GetChanges method.
     
    FrankvHoof likes this.
  5. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    This means creating your own version of ARKit/ARCore, which runs in the Editor.
    Is there a simple way to do that? Not really.

    To steal a line from Kirill:
    Thankfully, there are several products on the market that can do this, including my plugin :)

    Where Kirill's plugin is great for testing with actual real-world data, MockAR can be used to test with completely simulated environments inside of the Editor.
     
    KyryloKuzyk likes this.