Search Unity

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

Discussion in 'AR' started by cgitech, Nov 2, 2017.

  1. cgitech

    cgitech

    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:
    170
    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