Search Unity

GameObject to LookAt AR Camera

Discussion in 'Vuforia' started by asridr4gonz, Dec 19, 2017.

  1. asridr4gonz

    asridr4gonz

    Joined:
    Nov 19, 2017
    Posts:
    5
    I am having difficulty in trying to make a GameObject to constantly look at AR Camera. I feel that is not right as the AR Camera's position doesn't change. What feature should I look at so that my GameObject always faces the device screen?
     
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Hello @asridr4gonz

    What world center mode are you using? If you set it to camera, you can guarantee the camera is always at 0,0,0 and can rotate your object to face that point.

    Thanks
     
  3. asridr4gonz

    asridr4gonz

    Joined:
    Nov 19, 2017
    Posts:
    5
    Hi thanks for the reply. My world center mode is on first target.

    I'll try to explain my objective here. i have a gameobject(engine) which pops up on the my image target as intended. Im inserting a 3D text and my aim is for the 3D text to face the device camera at all times while my gameobject remains.

    What i think I might need as of now is the position of my device camera instead of the ARCamera. But I have no clue how can I refer to my device camera in the script.
     
  4. asridr4gonz

    asridr4gonz

    Joined:
    Nov 19, 2017
    Posts:
    5
    Ive found the solution! Yes indeed I have to switch the world center mode to "Camera" and it worked. It didnt work previously because i removed the LookAt (camera) script. My model stays while the text look at my camera.
     
  5. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Glad to hear you were able to find a solution!
     
  6. chanfui

    chanfui

    Joined:
    May 2, 2017
    Posts:
    11
    9.3.3 seems not working. Unity 2019.4.8f1. Checked a lot of places but no luck. Tried World Centre Mode to DEVICE, FIRST_TARGET seems not working too. LookAtObject.cs in Core Sample seems not working. Guys?
     
    Last edited: Aug 28, 2020