Orient game object to user by Billboard of MRTK


Summary

Q. How to keep a GameObject oriented towards the user?
A. Use Billboard component.

Prerequisites

  • MRTK v2.7
    • Mixed Reality Toolkit Foundation
  • Unity v2020.3.20f1
  • Windows 21H1

Steps

In your MRTK based scene, do the following steps:

  1. Add empty object.
  2. Add UI Backplate.prefab into the empty object.
    • The prefab can be found in Packages/com.microsoft.mixedreality.toolkit.foundation/SDK/StandardAssets/Prefabs.
    • Adjust scale it.
  3. Add UITextSelawik.prefab into the empty object.
    • The prefab can be found in Packages/com.microsoft.mixedreality.toolkit.foundation/SDK/StandardAssets/Prefabs/Text.
  4. Add Billboard component to the empty object.
  5. Adjust position of the empty object.

References

  1. Billboarding and tag-along – Mixed Reality | Microsoft Docs
  2. Billboard Class (Microsoft.MixedReality.Toolkit.UI) | Microsoft Docs