bool isUnityEvent;
if (!isUnityEvent)
{
if (transform.position == TargetLocation)
{
onReachTarget.AddListener(Test);
onReachTarget.Invoke();
isUnityEvent = true;
}
if (transform.position != TargetLocation)
{
isUnityEvent = false;
}
}
Here i already make the unity event trigger once in update, but when i move the TargetLocation and my object reach that destination the unity event doesn’t trigger.