Search Unity

ARFounadation - How to stop AR from moving the placed AR project?

Discussion in 'AR' started by Artificial_Illusions, May 11, 2019.

  1. Artificial_Illusions

    Artificial_Illusions

    Joined:
    Jul 24, 2018
    Posts:
    20
    Hello,
    I'd like to know what it is need to to to stop the AR app from moving the placed object when touching anywhere else on the screen (e.g. an UI button)?. Very time I click anywhere, the AR object gets relocated.
    I'd like to be able to stop the tracking (not to stop ARsession completely) once an AR object has been placed. Thank you.
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    ARFoundation doesn't do this directly. It sounds like you are describing behavior from one of the samples -- this is simply a guide to show you how to place an object from a raycast. If you'd like to stop this behavior after the object has been placed, remove the code from the else statement.
     
  3. Artificial_Illusions

    Artificial_Illusions

    Joined:
    Jul 24, 2018
    Posts:
    20
    That did it!.
    Also, this works best for prefabs I guess, but now I am seeing that I am benefiting more from the Place Content on transform than place on plane. But this one does not have an else statement, I guess I'll have to add one myself? Or just limit the hits to just one instead of using an array of hits?
    Thanks!
     
  4. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Sorry, what is "Place Content on transform"? Could you provide a link to the code on GitHub?
     
  5. Artificial_Illusions

    Artificial_Illusions

    Joined:
    Jul 24, 2018
    Posts:
    20
    My apologies, please disregard the "Place content on transform", I meant "Make Appear on Plane".
     
  6. TimeWalk-org

    TimeWalk-org

    Joined:
    Nov 3, 2014
    Posts:
    38
  7. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99