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,
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.
Thanks for the reply!
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.