Hi everyone, I am currently working on a simple navigation project that requires me to activate arrows when the AR camera collides with a certain point. However, I experience issue where when I press start in player controller, if I move fast enough as soon as I start, it will trigger the arrows (as shown this video).
However, if I don’t start right away, it doesn’t activate.
This is my point collider and my AR camera collider. And the code that is attached to my AR Camera.
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class Route1 : MonoBehaviour
{
public GameObject ArrowsRoute1;
public GameObject Point1;
public GameObject Point2;
public TextMeshProUGUI message;
// Start is called before the first frame update
void Start()
{
}
public void OnCollisionEnter(Collision col)
{
if (col.gameObject.tag == "Point1")
{
ArrowsRoute1.gameObject.SetActive(true);
Point1.gameObject.SetActive(false);
Point2.gameObject.SetActive(true);
}
if (col.gameObject.tag == "Point2")
{
ArrowsRoute1.gameObject.SetActive(false);
Point1.gameObject.SetActive(false);
Point2.gameObject.SetActive(false);
message = GetComponent<TextMeshProUGUI>();
}
}
// Update is called once per frame
void Update()
{
}
}
I have no idea why is it not activating consistently.
Thank you in advance for helping.