Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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 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:
    140
    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