Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to make gameobject always look at (AR-)camera? (billboard)

Discussion in 'Vuforia' started by MKrohn, May 18, 2018.

  1. MKrohn

    MKrohn

    Joined:
    Apr 5, 2018
    Posts:
    23
    Hi,

    I intend to have a number of billboards that always face the camera. Unfortunately, the ARCamera-object does not move at all in world space, so I cannot use its transform for calculations. Does anybody know how to get the world space position and orientation of the device camera? Or better yet, has anyone already accomplished billboards with Vuforia?
    So far, I'm a little lost googling and browsing the documentation.
     
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    If you set the World Center Mode to Camera on the Vuforia Configuration, the ARCamera will always be at 0,0,0. You can then rotate any objects in your world to point towards the camera to make them always be looking at the ARCamera.
     
    Amin- and MKrohn like this.
  3. MKrohn

    MKrohn

    Joined:
    Apr 5, 2018
    Posts:
    23
    Yes!! That worked! Thank you very much!
     
    Vuforia-Strasza likes this.
  4. adrianov

    adrianov

    Joined:
    Dec 23, 2015
    Posts:
    15
    I've got a shader handling billboarding for me, and it works fine in the editor, but not when I build, the default facing direction is offset somehow. I'm trying to see if this solution would help resolve my issue as well, but when I check the options for World Center Mode, I don't have the "Camera" option; the options I see are SPECIFIC_TARGET, FIRST_TARGET, or DEVICE. Am I missing something?
     
  5. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello @adrianov,

    CAMERA is an old option. In 7.5/8.0 we now have DEVICE. If you want to use 6DOF tracking (ARKit and HoloLens for example), DEVICE is the correct one.

    Thanks,
    Vuforia Engine Support
     
  6. jenewari_ela

    jenewari_ela

    Joined:
    Jul 2, 2019
    Posts:
    1
    Please i can't find AR Camera from the GameObject drop down menu...help please
     
  7. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello @jenewari_ela,

    Make sure you've enabled Vuforia Engine in your project: File->Build Settings...->Player Settings...->XR Settings->Vuforia Augmented Reality Support (checked)

    Thanks,
    Vuforia Engine Support
     
  8. dinnaaa

    dinnaaa

    Joined:
    Nov 24, 2019
    Posts:
    1
    Do i have to tag the camera to the object or anything like that? This doesn't seem to work for me.
     
  9. GreenJuicePowers13

    GreenJuicePowers13

    Joined:
    Feb 15, 2020
    Posts:
    5
    Ok, but now we all looking for the free option with ARFoundation. Vuforia is a S*** load expensive for all of us to get. Anybody know how to do it via arfoundation?