"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

adding/interacting with box collider on a ground plane

Hey y'all,

 

I'm trying to make a 6-foot circle on the ground around the user that turns red when someone enters the circle.

 

I added a box collider around the ground plane and set it as a trigger, then added this script that should enable the red circle and disable the green circle when someone enters it:

 

public class TriggerScript : MonoBehaviour {

    public GameObject redCircle;     public GameObject greenCircle;

    public void OnTriggerEnter(Collider other)     {         redCircle.SetActive(true);         greenCircle.SetActive(false);

    }

    public void OnTriggerExit(Collider other)     {

        redCircle.SetActive(false);         greenCircle.SetActive(true);     }

}

 

I think the issue is that the box collider is expecting to interact with another GameObject, not a person.

 

Anyone have any recommendations as to how I should go about this? Thanks!

 

Hi,

I believe you are on the right track. Yes, the box collider is expecting to interact with another GameObject that also has a Box collider.

jennahorrall

Tue, 04/21/2020 - 18:02

In reply to by mcotora

Thanks for the reply!

 

My current implementation has a ground plane with the circle on it directly under the ARCamera, so the circle is always around the user. I am trying to see if there is any way to collide with someone who enters the circle.