How to Check the Proper Difference of the status of the gameplay players destination

public void CheckPlayerStatusOnMovementEnd()
{
int PlayersMovementEnd=0;
//First Check All Players Have Movemenet End and Is ResetPosition will be False
for (int i = 0; i < GamePlayPlayers.Count; i++)
{
if(GamePlayPlayers.IsMovementEnd && !(GamePlayPlayers_.IsResetPostion) && !(GamePlayPlayers*.PlayerAtDestinationPosition))
{
PlayersMovementEnd++;
}
}
//When Both Players not Reahed to Destination*
if ((PlayersMovementEnd == GamePlayPlayers.Count))
{
Debug.Log(“All Players Not Reach To Destination”);
ReferenceManger.Instance.GamePlayManagers.OnGameFailed?.Invoke();
return;
}_

//ProcessOnlyWhen All The Players Have Not Reset Variable false if one will be true then Break the Process
bool AnyOneHaveResetVariable = false;
for (int i = 0; i < GamePlayPlayers.Count; i++)
{
if(GamePlayPlayers*.IsResetPostion)*
{
AnyOneHaveResetVariable = true;
break;
}
}

if(!AnyOneHaveResetVariable)
{
if(!ReferenceManger.Instance.GamePlayManagers.IsGameCompleteStatus())
{
Debug.Log(“Game Condition Fail”);
ReferenceManger.Instance.GamePlayManagers.OnGameFailed?.Invoke();
}

}

}

public void CheckPlayerReachedAt()
{

int Count = 0;
for (int i = 0; i < GamePlayPlayers.Count; i++)
{
if (GamePlayPlayers*.PlayerAtDestinationPosition)*
{

Count++;
}
else
{
Count–;
}

}
if (Count==GamePlayPlayers.Count)
{
ReferenceManger.Instance.GamePlayManagers.OnGameComplete?.Invoke();
Debug.Log(“Reach”);
}

}

You should give more context in order to make people understand your problem.


For what I have understood, I can say that Vector3.Distance (you give twoTransforms, it returns the distance between the two) helps you to see if players reach a destination, if this is not the answer you are looking for let me know and update the post to make us understand better.


Have a nice day, Patrick.