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

AF Foundation - Checking camera intersection with GameObjects?

Discussion in 'AR' started by scottunity, Jul 21, 2019.

  1. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    What's the best method to check the intersection of the device (with camera) and a game object?
    As the user moves in AR space I want to trigger actions as they walk through various game objects.
     
  2. astratakis

    astratakis

    Joined:
    Mar 18, 2019
    Posts:
    10
    You can use colliders on your Gameobjects and enable "Is Trigger". Then handle them with
    OnTriggerEnter and OnTriggerExit methods. Note that your Session Origin must have a Rigidbody attached.