Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

How to interact with GameObject (3D model) once being placed in real world?

Discussion in 'ARCore' started by thomashuangtarget, Nov 2, 2017.

  1. thomashuangtarget

    thomashuangtarget

    Joined:
    Nov 2, 2017
    Posts:
    1
    Hi,
    I was wondering if anyone has suggestion how to interact with the 3D gameObject once it's being placed to the real world? I was able to figure (from previous posts) how to interact with UI within ARCore, but I don't seem to be able to make interactions with 3D object. When I tab on the object, a new object just generate overlapping the old one, instead of recognizing the collider. Thanks!

    Thomas
     
    aakashdabrase and henryashton69 like this.
  2. trilokves

    trilokves

    Joined:
    Nov 30, 2017
    Posts:
    5
    I would like to know the same
     
  3. kdarius43

    kdarius43

    Joined:
    Mar 16, 2015
    Posts:
    134
    Yes this would be very helpful if anyone has any ideas.
     
  4. shyam_barange

    shyam_barange

    Joined:
    May 19, 2017
    Posts:
    1
    this can be done easily, use lean touch and you can interact with your 3D model.
    also to prevent spawn new object on touch you can write a small code in the HelloARController.cs file.

    define a bool variable inside class:
    bool isSpawned =false;
    .....

    // now replace this line..
    if (Frame.Raycast(touch.position.x, touch.position.y, raycastFilter, out hit) && isSpawned == false))
    {
    isSpawned = true;

    .......
    //rest code is same