Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created August 10, 2021 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andijakl/197b741bac9f9d5f05422d8672c75845 to your computer and use it in GitHub Desktop.
Save andijakl/197b741bac9f9d5f05422d8672c75845 to your computer and use it in GitHub Desktop.
Part 1 of the script to place holograms based on raycasts with AR Foundation
public class ARPlaceHologram : MonoBehaviour
{
// The prefab to instantiate on touch.
[SerializeField]
private GameObject _prefabToPlace;
// Cache ARRaycastManager GameObject from ARCoreSession
private ARRaycastManager _raycastManager;
// List for raycast hits is re-used by raycast manager
private static readonly List<ARRaycastHit> Hits = new List<ARRaycastHit>();
void Awake()
{
_raycastManager = GetComponent<ARRaycastManager>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment