Search Unity

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

    carlharrison1

    Joined:
    Feb 5, 2017
    Posts:
    17
    Hi,

    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

    NickBullseye

    Joined:
    Nov 30, 2016
    Posts:
    10
    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

    vfxdad

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