Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Anchoring my game object and then being able to press anywhere on the screen

Discussion in 'AR' started by carlharrison1, Jan 10, 2018.

  1. carlharrison1


    Feb 5, 2017

    So I have been watching umpteen ARkit tutorials and I can't seem to find the answer to my problem. I'm literally falling at the first hurdle.

    I'm trying to work out HOW, once a plane is found, you've instantiated your game object and you're happy... stopping the instantiation! So my idea was to add a button which basically turns off the ARHitTestResultType but this hasn't been working. How are these other games and apps doing it, can somebody please tell me best practice here please?

    All I want to do is say, "Ok, Ive picked the area I want to instantiate, now I want to interact with the object with touches etc". Im amending all sorts of the code but being a useless coder Im obviously hitting the wrong areas

    Thanks for the advice
  2. NickBullseye


    Nov 30, 2016
    Well, I hope I understood your intentions right. I guess you are raycasting to detect whether you touched a plane or not. So I would recommend to store the boolean variable, which is set to false untill you pick the area to instanitate your object to (click the generated plane for the first time for example). Once picked, set it to true. Then just use tags to detect what you are hitting. But, if your intentions are to stop the plane detection after you set your content, its another topic.
  3. vfxdad


    Aug 9, 2017
    Hi Carl, were you able to figure this out? I'm running into the same thing!